Tone.js/test/README.md

20 lines
1.2 KiB
Markdown
Raw Normal View History

2016-03-29 23:42:31 +00:00
I am currently using two test runners: [mocha](https://mochajs.org/) and [karma](https://github.com/karma-runner/karma) + mocha.
2015-10-21 17:14:19 +00:00
From within the gulp folder, run `gulp karma-test` to collect all of the files, launch a local server and run the tests.
2016-03-29 23:42:31 +00:00
Be sure that the browser window is in focus while tests are running.
Individual files can be tested by running `gulp collectTests -f [Tone class name]` which will update the test/Main.js with the given class' tests. You can then refresh the `test/index.html` page to rerun those tests.
2015-10-21 17:14:19 +00:00
You can also test groups of classes by folder by adding another flag. For example to test all of the signals run `gulp collectTests --signal`. or the shorthand form: `gulp collectTests -s`.
* `-s` = `--signal`
* `-i` = `--instrument`
* `-o` = `--source`
2015-11-04 20:59:09 +00:00
* `-v` = `--event`
2015-10-21 17:14:19 +00:00
* `-e` = `--effect`
* `-c` = `--core`
* `-m` = `--component`
2015-11-04 20:59:09 +00:00
* `-t` = `--control`
2015-10-21 17:14:19 +00:00
2016-03-29 23:42:31 +00:00
The tests target the latest [specification](https://webaudio.github.io/web-audio-api/) and not any specific browser. I have been keeping a list of which features browsers/versions currently support in `test/helper/Supports.js`. Some tests are only conditionally run if that feature is supported on the platform.