This provides diagnostic tests for basic WebRTC functionality. See the test-page directory for usage.
git clonethis repository
- Run unit-tests using
- Develop against the diagnostic tests using
npm startand navigating to http://localhost:8080/test-page
To develop diagnostic tests this repo has a utility ./test-page/index.html that pulls in the tests and runs them in the browser. For WebRTC connections, most of the tests force the use of
relay since the tests make peer connections to the same host.
npm startwill run webpack with the
--watchflag and serve the test-page using stupid server.
- This is super helpful when you are writing new tests. You will still need to refrash the browser to pick up any new changes, but at least webpack will rebuild the app when you save a file :)
test-page/index.html for console output of 6 tests to ensure webrtc is properly functioning
Here is a stringified version of google's STUN servers for quick reference. Granted, you will still need an active TURN server for some of these tests to pass, but this will get the tests started.
The tests now use Jest!
Test names must match the
*.spec.jsnaming convention. This is configured in jest.config.js
npm testwill run both linting, all the unit-test, and report coverage in text form in the command line.
npm run test:watchwill run only the unit-tests and watch the files for changes (it also skips code coverage reporting).