beartest-js 6.0.0 → 6.0.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.
- package/beartest.js +4 -4
- package/index.d.ts +4 -11
- package/package.json +1 -1
package/beartest.js
CHANGED
|
@@ -81,16 +81,16 @@ describe.only = (headline, fn) => makeSuite(headline, true, fn);
|
|
|
81
81
|
const it = (name, fn) => topSafe().tests.push(registerTest(topSafe(), name, fn));
|
|
82
82
|
it.only = (name, fn) => topSafe().only.push(registerTest(topSafe(), name, fn));
|
|
83
83
|
it.skip = () => {};
|
|
84
|
-
const
|
|
85
|
-
const
|
|
84
|
+
const before = (fn) => topSafe().beforeAllHooks.push(fn);
|
|
85
|
+
const after = (fn) => topSafe().afterAllHooks.push(fn);
|
|
86
86
|
const beforeEach = (fn) => topSafe().beforeEachHooks.push(fn);
|
|
87
87
|
const afterEach = (fn) => topSafe().afterEachHooks.push(fn);
|
|
88
88
|
|
|
89
89
|
module.exports = {
|
|
90
90
|
test: Object.assign(it, {
|
|
91
91
|
describe,
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
before,
|
|
93
|
+
after,
|
|
94
94
|
beforeEach,
|
|
95
95
|
afterEach,
|
|
96
96
|
}),
|
package/index.d.ts
CHANGED
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
type testFn = (name: string, fn: () => unknown) => void;
|
|
2
2
|
|
|
3
|
-
type
|
|
3
|
+
type BearTest = testFn & {
|
|
4
4
|
skip: testFn;
|
|
5
5
|
only: testFn;
|
|
6
6
|
describe: testFn & { skip: testFn; only: testFn };
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
before(fn: () => unknown): void;
|
|
8
|
+
after(fn: () => unknown): void;
|
|
9
9
|
beforeEach(fn: () => unknown): void;
|
|
10
10
|
afterEach(fn: () => unknown): void;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
type It = test & { only: test; skip: test };
|
|
15
|
-
type BeforeAll = (fn: () => void | Promise<void>) => void;
|
|
16
|
-
type AfterAll = (fn: () => void | Promise<void>) => void;
|
|
17
|
-
type BeforeEach = (fn: () => void | Promise<void>) => void;
|
|
18
|
-
type AfterEach = (fn: () => void | Promise<void>) => void;
|
|
19
|
-
|
|
20
|
-
export declare const test: test;
|
|
13
|
+
export declare const test: BearTest;
|
|
21
14
|
export declare const runner: {
|
|
22
15
|
waitForTests: Promise<void>;
|
|
23
16
|
};
|