I'd like to add new assertions to QUnit. I've done something this:
QUnit.extend(QUnit.assert, {
increases: function(measure, block, message){
var before = measure();
block();
var after = measure();
var passes = before < after;
QUnit.push(passes, after, "< " + before, message);
}
});
When I use increases(foo,bar,baz)
in my test, I get
ReferenceError: increases is not defined
From the browser console I can see increases
is found in QUnit.assert
along with all the other standard functions: ok
, equal
, deepEqual
, etc.
From the console, running:
test("foo", function(){console.log(ok) });
I see the source of ok
.
Running:
test("foo", function(){console.log(increases) });
I am told increases is not defined.
What is the magic required to use my increases in a test? Also, where (if anywhere) is the documentation for that?
Thanks
window
. – Ranger