mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
Merge pull request #6956 from Malyngo/master
Qunit: Add QunitAssert parameter to setup functions
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) {
|
||||
|
||||
Vendored
+8
-4
@@ -148,23 +148,27 @@ interface URLConfigItem {
|
||||
interface LifecycleObject {
|
||||
/**
|
||||
* Runs before each test
|
||||
* @param assert
|
||||
* @deprecated
|
||||
*/
|
||||
setup?: () => void;
|
||||
setup?: (assert: QUnitAssert) => void;
|
||||
|
||||
/**
|
||||
* Runs after each test
|
||||
* @param assert
|
||||
* @deprecated
|
||||
*/
|
||||
teardown?: () => void;
|
||||
teardown?: (assert: QUnitAssert) => void;
|
||||
/**
|
||||
* Runs before each test
|
||||
* @param assert
|
||||
*/
|
||||
beforeEach?: () => void;
|
||||
beforeEach?: (assert: QUnitAssert) => void;
|
||||
/**
|
||||
* Runs after each test
|
||||
* @param assert
|
||||
*/
|
||||
afterEach?: () => void;
|
||||
afterEach?: (assert: QUnitAssert) => void;
|
||||
|
||||
/**
|
||||
* Any additional properties on the hooks object will be added to that context.
|
||||
|
||||
Reference in New Issue
Block a user