Tone.js/test
Yotam Mann 6ea1ca0a18 converting BitCrusher to typescript
uses the AudioWorklet
2019-10-28 19:11:46 -04:00
..
audio converting BitCrusher to typescript 2019-10-28 19:11:46 -04:00
component Merge branch 'pr/521' into typescript 2019-08-19 19:02:07 -07:00
control testing that changing pattern length should update shuffle 2019-02-01 11:33:26 -05:00
core organizing into sub folders 2019-05-23 14:00:49 -04:00
effect testing setting/getting the delayTime 2019-01-31 12:16:25 -05:00
event Add tests for Event and Part loop behavior when loop is false, 0 or 1 2019-07-08 13:47:09 -04:00
helper using the unit name instead of the unit type as the Param generic 2019-10-28 11:37:53 -04:00
html removing old example tests 2019-01-08 22:22:09 -05:00
instrument increasing threshold 2019-03-08 12:32:05 -05:00
signal organizing into sub folders 2019-05-23 14:00:49 -04:00
source removing old JS files 2019-06-19 10:18:43 -04:00
type organizing into sub folders 2019-05-23 14:00:49 -04:00
index.html invoke test with timeout 2018-05-18 18:03:58 -04:00
README.md only using karma test runner with headless chrome 2017-06-29 17:31:10 -04:00

I am currently using two test runners: mocha and karma + mocha.

From within the gulp folder, run gulp karma-test to collect all of the files, launch a local server and run the tests.

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.

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
  • -v = --event
  • -e = --effect
  • -c = --core
  • -m = --component
  • -t = --control

The tests target the latest specification 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.