@japa/runner 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { DataSetNode, Test as BaseTest, Group as BaseGroup, Suite as BaseSuite, Runner as BaseRunner, TestHooksCleanupHandler, TestContext as BaseTestContext } from '@japa/core';
|
|
2
2
|
export declare class TestContext extends BaseTestContext {
|
|
3
3
|
test: Test;
|
|
4
|
+
cleanup: (handler: TestHooksCleanupHandler<this>) => void;
|
|
4
5
|
constructor(test: Test);
|
|
5
|
-
/**
|
|
6
|
-
* Define a test cleanup hook
|
|
7
|
-
*/
|
|
8
|
-
cleanup(handler: TestHooksCleanupHandler<this>): this;
|
|
9
6
|
}
|
|
10
7
|
export declare class Test<TestData extends DataSetNode = undefined> extends BaseTest<TestContext, TestData> {
|
|
11
8
|
static disposeCallbacks: never[];
|
package/build/src/Core/index.js
CHANGED
|
@@ -14,13 +14,9 @@ class TestContext extends core_1.TestContext {
|
|
|
14
14
|
constructor(test) {
|
|
15
15
|
super();
|
|
16
16
|
this.test = test;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*/
|
|
21
|
-
cleanup(handler) {
|
|
22
|
-
this.test.cleanup(handler);
|
|
23
|
-
return this;
|
|
17
|
+
this.cleanup = (handler) => {
|
|
18
|
+
test.cleanup(handler);
|
|
19
|
+
};
|
|
24
20
|
}
|
|
25
21
|
}
|
|
26
22
|
exports.TestContext = TestContext;
|