Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decoder unit tests added #1507

Merged
merged 9 commits into from Jan 29, 2018
Merged

Conversation

capagrisdesu
Copy link
Contributor

Description of the Changes

As I have been concerned about how to improve coverage in hls.js I decided to experiment doing some unit tests using sinon to mock objects. Hls.js modules are fairly complex and testing one function usually requires testing hundreds of lines which is not ideal for the purpose of unit tests so this is showcase demo of how to test small pieces of code. I decided to use Demuxer as it is a fundamental piece of the library that has not yet been unit tested. This is useful to the project and others may use sinon in similar fashion in order to do more unit tests and increase the current low coverage of the library.

CheckLists

  • changes have been done against master branch, and PR does not conflict
  • no commits have been done in dist folder (we will take care of updating it)
  • new unit / functional tests have been added (whenever applicable)
  • Travis tests are passing (or test results are not worse than on master branch :))
  • API or design changes are documented in API.md

@mangui
Copy link
Member

mangui commented Jan 20, 2018

thanks @capagrisdesu, could u rebase against latest master as unit tests are not passing on Travis ?

@capagrisdesu
Copy link
Contributor Author

You are welcome @mangui but I can see that the error in Travis is
252517 01 2018 21:33:36.421:ERROR [launcher]: Cannot start ChromeHeadless
2526 [0117/213336.294249:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /opt/google/chrome/chrome-sandbox is owned by root and has mode 4755.
That does not sound like there is a problem with my unit tests although I will be rebase.

@mangui
Copy link
Member

mangui commented Jan 22, 2018

these issues should have been fixed on master
3d504e2

@capagrisdesu
Copy link
Contributor Author

@mangui If you run master npm run test, you will get errors. I am concerned that this happens fairly frequently. Maybe people are not checking their PRs before submitting them.

hls.js@0.8.9 lint \Git\publichls.js
jshint src/

src\remux\mp4-remuxer.js: line 209, col 30, Expected '===' and instead saw '=='.
src\remux\mp4-remuxer.js: line 210, col 9, Expected '{' and instead saw 'return'.

@capagrisdesu
Copy link
Contributor Author

Hi @mangui unit test passing, could you merge?

@mangui
Copy link
Member

mangui commented Jan 29, 2018

thanks for this PR, LGTM merging

@mangui mangui merged commit 8a67c5b into video-dev:master Jan 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants