mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-12 12:10:44 +08:00
Add QunitAssert parameter to setup functions
Add QunitAssert parameter to the setup, teardown, beforeEach and afterEach functions. This facilitates the usage of for example async code in the setup.
This commit is contained in:
@@ -170,6 +170,30 @@ QUnit.module("module A", {
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.module("module with async setup and teardown", {
|
||||
setup: function (assert) {
|
||||
var done = assert.async();
|
||||
setTimeout(function () {
|
||||
// prepare something for all following tests
|
||||
});
|
||||
},
|
||||
teardown: function (assert) {
|
||||
// clean up after each test
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.module("module with async setup and teardown", {
|
||||
beforeEach: function (assert: QUnitAssert) {
|
||||
var done = assert.async();
|
||||
setTimeout(function () {
|
||||
// prepare something for all following tests
|
||||
});
|
||||
},
|
||||
afterEach: function () {
|
||||
// clean up after each test
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.test("a test", function (assert) {
|
||||
|
||||
function square(x) {
|
||||
|
||||
Reference in New Issue
Block a user