Tone.js/test
David Sherman c66c453e95 Added type property to Tone.Meter (#276)
* Added 'type' property to Tone.Meter that accepts 'peak' or 'rms' and defaults to 'rms'. Calculation methods + sources added to Tone.Meter. Tests added to Tone.Meter + assertion sources.

* Fixed a number of formatting issues

* more formatting fixes

* Formatting for CI

* fixed variable names

* Updated to use existing gainToDb method.

* Removed tests of removed method.

* Removed whitespaces and tabs.

* Moved Supports.ONLINE_TESTING to original position

* Moded Supports.ONLINE_TESTING to top
2018-05-16 10:41:02 -04:00
..
audio additional NoiseSynth tests 2018-04-25 10:29:07 -04:00
component Added type property to Tone.Meter (#276) 2018-05-16 10:41:02 -04:00
control linting 2017-12-30 11:26:29 -05:00
core updating Draw tests 2018-04-25 11:50:37 -04:00
deps compare rendered output to previously rendered audio files 2018-02-05 13:55:37 -05:00
effect adjusting test threshs to be less susceptible to randomness 2018-01-17 13:40:18 -05:00
event extending test durations 2018-03-05 22:58:28 -05:00
examples linting 2017-12-30 11:26:29 -05:00
helper Time classes take Object notation as well 2018-04-25 10:51:36 -04:00
instrument expanding tolerence 2018-04-25 10:51:46 -04:00
signal TickSignal is slightly more accurate 2018-02-27 17:04:01 -05:00
source removing retrigger, maintaining array of activeSources 2018-03-05 22:26:37 -05:00
type toBarsBeatsSixteenths tests 2018-05-15 10:15:30 -04:00
.jshintrc adding "before" and "context" 2015-08-18 17:08:48 -04:00
index.html silence version logging in tests 2017-11-29 15:23:20 -05:00
karmaTest.js adding polyfill 2017-12-30 00:30:52 -05: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.