Tone.js/test
2017-04-27 00:54:11 -04:00
..
audio using rest of effects tests on Convolver 2016-08-09 14:25:20 -04:00
component testing that volume is muted when -Infinity is passed into constructor 2017-03-26 16:42:35 -04:00
control applying defaults API to control classes 2017-04-25 22:37:01 -04:00
core gainToDb, dbToGain, intervalToFrequencyRatio now static functions 2017-04-26 23:21:26 -04:00
deps cross checking note conversions against teoria 2015-08-16 22:17:59 -04:00
effect removing convolver effects tests that throw an error when running in TravisCI 2016-11-22 10:46:26 -08:00
event updating to new Offline API 2017-02-19 20:48:22 -05:00
examples throw error if URL doesn't exist 2017-03-26 15:21:45 -04:00
helper testing static type queries 2017-04-26 00:27:49 -04:00
instrument testing passing in values to PolySynth 2017-04-26 00:08:33 -04:00
signal replacing remaining static methods to new API 2017-04-27 00:54:11 -04:00
source sources to new defaults api 2017-04-26 00:00:01 -04:00
type eval -> valueOf 2017-03-12 21:31:23 -04:00
.jshintrc adding "before" and "context" 2015-08-18 17:08:48 -04:00
index.html renamed test html file 2015-08-17 01:04:04 -04:00
karmaTest.js test all examples for execution errors 2017-03-26 14:51:25 -04:00
README.md updated testing README 2016-03-29 19:42:31 -04:00

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

From within the gulp folder, run gulp browser-test to collect all of the files, launch a local server and run the tests. If you run gulp karma-test, the tests can be configured to run across multiple browsers simultaneously.

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.