Tone.js/test/test.js
Yotam Mann 71af6ca206 testing dispose methods for all classes.
a few classes were not being disposed correctly and leaving some
garbage attached.
2014-09-06 18:55:11 -04:00

38 lines
No EOL
878 B
JavaScript

require.config({
baseUrl:"./",
paths : {
"Tone" : "../Tone",
"chai" : "./testDeps/chai",
"Recorder" : "./testDeps/recorder"
},
shim : {
"Recorder" : {
exports : "Recorder"
}
}
});
var recorderDelay = 0.5;
var recorderDuration = 0.1;
var maxTimeout = 1000;
function wasDisposed(obj, expect){
for (var prop in obj){
var member = obj[prop];
if (typeof member !== "function" &&
typeof member !== "string" &&
typeof member !== "number" &&
typeof member !== "boolean" &&
!(member instanceof AudioContext)){
expect(obj[prop]).to.equal(null);
}
}
}
var allTests = ["tests/Core", "tests/Timing", "tests/Signal", "tests/SignalComparison",
"tests/SignalMath", "tests/Transport", "tests/Sources", "tests/Components", "tests/Effect"];
// var allTests = ["tests/Core", "tests/SignalComparison"];
require(allTests, function(){
mocha.run();
});