Add tests for media streaming routes (Range, 416, HEAD, audio)
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- javascript, node.js
Research direction
Read test/media.test.js, media.js:21-36, and server.js:87-105; inspect the files in showcase/media/ with stat() to get expected sizes. Add createApp() tests for the listed GET, Range, HEAD, audio, and unknown-id cases, then run npm test. Done means the tests pass and a broken Content-Range in media.js:29 fails a test.
Written by the indexing model from the issue text.
Description
test/media.test.js only tests byteRange(). Nothing tests streamVideo() (media.js:21-36) or the /media/references/... routes (server.js:87-105), even though seeking and the export's audio depend on them. test/server.test.js:43 checks only the 404 for an excluded reference.
Add tests against createApp() using a showcase id (for example 69614b10fa87):
GET .../69614b10fa87.mp4returns 200,Accept-Ranges: bytes, and aContent-Lengthequal to the file size.Range: bytes=0-99returns 206,Content-Range: bytes 0-99/<size>, and a 100-byte body.Range: bytes=999999999-returns 416 withContent-Range: bytes */<size>.HEADreturns the headers with an empty body.GET .../69614b10fa87.aacreturns 200 withaudio/aac.- An unknown id such as
.../nope.mp4returns 404.
Get the expected sizes from stat() on the files in showcase/media/, not hard-coded numbers.
Done when the new tests pass with npm test, and breaking Content-Range in media.js:29 makes one of them fail.
- Dominant language
- HTML
- Stars
- 1.2k
- Forks
- 109
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from blixvip/NullMotion
-
accessibility help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
blixvip/NullMotion#47 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
blixvip/NullMotion#43 ·
-
accessibility good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
blixvip/NullMotion#42 ·
-
accessibility good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
blixvip/NullMotion#41 ·
-
accessibility good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
blixvip/NullMotion#40 ·
All issues in blixvip/NullMotion
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
nopSolutions/nopCommerce#8459 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
nikic/PHP-Parser#1187 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NanmiCoder/MediaCrawler#1004 ·
-
area: cpu-engines area: fuzzer good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
hffgzktbcc-blip/ounce-core#402 ·
Maintainers usually reply within 1 day