Replaced jasmine testing framework by mocha, expect.js and sinon
as discussed in #319
This commit is contained in:
24
test/test-extensions.js
Normal file
24
test/test-extensions.js
Normal file
@@ -0,0 +1,24 @@
|
||||
function waitsFor(condition, message, timeout, callback) {
|
||||
var timeWaiting = 0;
|
||||
|
||||
function inner() {
|
||||
if (condition()) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
|
||||
if (timeWaiting >= timeout) {
|
||||
throw new Error(message);
|
||||
}
|
||||
|
||||
timeWaiting += 10;
|
||||
setTimeout(inner, 10);
|
||||
}
|
||||
|
||||
inner();
|
||||
}
|
||||
|
||||
|
||||
expect.Assertion.prototype.roughlyEqual = function(other, tol) {
|
||||
return Math.abs(this.actual - other) <= tol;
|
||||
};
|
||||
Reference in New Issue
Block a user