@sprucelabs/test-utils 5.5.10 → 5.5.11

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,3 +1,18 @@
1
+ export default class SpruceTestResolver {
2
+ static ActiveTestClass?: any;
3
+ private static __activeTest;
4
+ static resolveTestClass(target: any): any;
5
+ static getActiveTest(): any;
6
+ static reset(): void;
7
+ static onWillCallBeforeAll(cb: TestLifecycleListener): void;
8
+ static onDidCallBeforeAll(cb: TestLifecycleListener): void;
9
+ static onWillCallBeforeEach(cb: TestLifecycleListener): void;
10
+ static onDidCallBeforeEach(cb: TestLifecycleListener): void;
11
+ static onWillCallAfterEach(cb: TestLifecycleListener): void;
12
+ static onDidCallAfterEach(cb: TestLifecycleListener): void;
13
+ static onWillCallAfterAll(cb: TestLifecycleListener): void;
14
+ static onDidCallAfterAll(cb: TestLifecycleListener): void;
15
+ }
1
16
  type TestLifecycleListener = (Test: any) => any | Promise<any>;
2
17
  export declare class TestLifecycleListeners {
3
18
  static willBeforeAllListeners: TestLifecycleListener[];
@@ -17,19 +32,4 @@ export declare class TestLifecycleListeners {
17
32
  static emitWillRunAfterAll(): Promise<void>;
18
33
  static emitDidRunAfterAll(): Promise<void>;
19
34
  }
20
- export default class SpruceTestResolver {
21
- static ActiveTestClass?: any;
22
- private static __activeTest;
23
- static resolveTestClass(target: any): any;
24
- static getActiveTest(): any;
25
- static reset(): void;
26
- static onWillCallBeforeAll(cb: TestLifecycleListener): void;
27
- static onDidCallBeforeAll(cb: TestLifecycleListener): void;
28
- static onWillCallBeforeEach(cb: TestLifecycleListener): void;
29
- static onDidCallBeforeEach(cb: TestLifecycleListener): void;
30
- static onWillCallAfterEach(cb: TestLifecycleListener): void;
31
- static onDidCallAfterEach(cb: TestLifecycleListener): void;
32
- static onWillCallAfterAll(cb: TestLifecycleListener): void;
33
- static onDidCallAfterAll(cb: TestLifecycleListener): void;
34
- }
35
35
  export {};
@@ -1,6 +1,47 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TestLifecycleListeners = void 0;
4
+ class SpruceTestResolver {
5
+ static resolveTestClass(target) {
6
+ if (!this.__activeTest) {
7
+ this.__activeTest = this.ActiveTestClass
8
+ ? new this.ActiveTestClass()
9
+ : target;
10
+ }
11
+ return this.__activeTest;
12
+ }
13
+ static getActiveTest() {
14
+ return this.__activeTest;
15
+ }
16
+ static reset() {
17
+ delete this.__activeTest;
18
+ }
19
+ static onWillCallBeforeAll(cb) {
20
+ TestLifecycleListeners.willBeforeAllListeners.push(cb);
21
+ }
22
+ static onDidCallBeforeAll(cb) {
23
+ TestLifecycleListeners.didBeforeAllListeners.push(cb);
24
+ }
25
+ static onWillCallBeforeEach(cb) {
26
+ TestLifecycleListeners.willBeforeEachListeners.push(cb);
27
+ }
28
+ static onDidCallBeforeEach(cb) {
29
+ TestLifecycleListeners.didBeforeEachListeners.push(cb);
30
+ }
31
+ static onWillCallAfterEach(cb) {
32
+ TestLifecycleListeners.willAfterEachListeners.push(cb);
33
+ }
34
+ static onDidCallAfterEach(cb) {
35
+ TestLifecycleListeners.didAfterEachListeners.push(cb);
36
+ }
37
+ static onWillCallAfterAll(cb) {
38
+ TestLifecycleListeners.willAfterAllListeners.push(cb);
39
+ }
40
+ static onDidCallAfterAll(cb) {
41
+ TestLifecycleListeners.didAfterAllListeners.push(cb);
42
+ }
43
+ }
44
+ exports.default = SpruceTestResolver;
4
45
  class TestLifecycleListeners {
5
46
  static async emitWillRunBeforeAll() {
6
47
  for (const cb of this.willBeforeAllListeners) {
@@ -52,44 +93,3 @@ TestLifecycleListeners.willAfterEachListeners = [];
52
93
  TestLifecycleListeners.didAfterEachListeners = [];
53
94
  TestLifecycleListeners.willAfterAllListeners = [];
54
95
  TestLifecycleListeners.didAfterAllListeners = [];
55
- class SpruceTestResolver {
56
- static resolveTestClass(target) {
57
- if (!this.__activeTest) {
58
- this.__activeTest = this.ActiveTestClass
59
- ? new this.ActiveTestClass()
60
- : target;
61
- }
62
- return this.__activeTest;
63
- }
64
- static getActiveTest() {
65
- return this.__activeTest;
66
- }
67
- static reset() {
68
- delete this.__activeTest;
69
- }
70
- static onWillCallBeforeAll(cb) {
71
- TestLifecycleListeners.willBeforeAllListeners.push(cb);
72
- }
73
- static onDidCallBeforeAll(cb) {
74
- TestLifecycleListeners.didBeforeAllListeners.push(cb);
75
- }
76
- static onWillCallBeforeEach(cb) {
77
- TestLifecycleListeners.willBeforeEachListeners.push(cb);
78
- }
79
- static onDidCallBeforeEach(cb) {
80
- TestLifecycleListeners.didBeforeEachListeners.push(cb);
81
- }
82
- static onWillCallAfterEach(cb) {
83
- TestLifecycleListeners.willAfterEachListeners.push(cb);
84
- }
85
- static onDidCallAfterEach(cb) {
86
- TestLifecycleListeners.didAfterEachListeners.push(cb);
87
- }
88
- static onWillCallAfterAll(cb) {
89
- TestLifecycleListeners.willAfterAllListeners.push(cb);
90
- }
91
- static onDidCallAfterAll(cb) {
92
- TestLifecycleListeners.didAfterAllListeners.push(cb);
93
- }
94
- }
95
- exports.default = SpruceTestResolver;
@@ -1,3 +1,18 @@
1
+ export default class SpruceTestResolver {
2
+ static ActiveTestClass?: any;
3
+ private static __activeTest;
4
+ static resolveTestClass(target: any): any;
5
+ static getActiveTest(): any;
6
+ static reset(): void;
7
+ static onWillCallBeforeAll(cb: TestLifecycleListener): void;
8
+ static onDidCallBeforeAll(cb: TestLifecycleListener): void;
9
+ static onWillCallBeforeEach(cb: TestLifecycleListener): void;
10
+ static onDidCallBeforeEach(cb: TestLifecycleListener): void;
11
+ static onWillCallAfterEach(cb: TestLifecycleListener): void;
12
+ static onDidCallAfterEach(cb: TestLifecycleListener): void;
13
+ static onWillCallAfterAll(cb: TestLifecycleListener): void;
14
+ static onDidCallAfterAll(cb: TestLifecycleListener): void;
15
+ }
1
16
  type TestLifecycleListener = (Test: any) => any | Promise<any>;
2
17
  export declare class TestLifecycleListeners {
3
18
  static willBeforeAllListeners: TestLifecycleListener[];
@@ -17,19 +32,4 @@ export declare class TestLifecycleListeners {
17
32
  static emitWillRunAfterAll(): Promise<void>;
18
33
  static emitDidRunAfterAll(): Promise<void>;
19
34
  }
20
- export default class SpruceTestResolver {
21
- static ActiveTestClass?: any;
22
- private static __activeTest;
23
- static resolveTestClass(target: any): any;
24
- static getActiveTest(): any;
25
- static reset(): void;
26
- static onWillCallBeforeAll(cb: TestLifecycleListener): void;
27
- static onDidCallBeforeAll(cb: TestLifecycleListener): void;
28
- static onWillCallBeforeEach(cb: TestLifecycleListener): void;
29
- static onDidCallBeforeEach(cb: TestLifecycleListener): void;
30
- static onWillCallAfterEach(cb: TestLifecycleListener): void;
31
- static onDidCallAfterEach(cb: TestLifecycleListener): void;
32
- static onWillCallAfterAll(cb: TestLifecycleListener): void;
33
- static onDidCallAfterAll(cb: TestLifecycleListener): void;
34
- }
35
35
  export {};
@@ -1,3 +1,43 @@
1
+ export default class SpruceTestResolver {
2
+ static resolveTestClass(target) {
3
+ if (!this.__activeTest) {
4
+ this.__activeTest = this.ActiveTestClass
5
+ ? new this.ActiveTestClass()
6
+ : target;
7
+ }
8
+ return this.__activeTest;
9
+ }
10
+ static getActiveTest() {
11
+ return this.__activeTest;
12
+ }
13
+ static reset() {
14
+ delete this.__activeTest;
15
+ }
16
+ static onWillCallBeforeAll(cb) {
17
+ TestLifecycleListeners.willBeforeAllListeners.push(cb);
18
+ }
19
+ static onDidCallBeforeAll(cb) {
20
+ TestLifecycleListeners.didBeforeAllListeners.push(cb);
21
+ }
22
+ static onWillCallBeforeEach(cb) {
23
+ TestLifecycleListeners.willBeforeEachListeners.push(cb);
24
+ }
25
+ static onDidCallBeforeEach(cb) {
26
+ TestLifecycleListeners.didBeforeEachListeners.push(cb);
27
+ }
28
+ static onWillCallAfterEach(cb) {
29
+ TestLifecycleListeners.willAfterEachListeners.push(cb);
30
+ }
31
+ static onDidCallAfterEach(cb) {
32
+ TestLifecycleListeners.didAfterEachListeners.push(cb);
33
+ }
34
+ static onWillCallAfterAll(cb) {
35
+ TestLifecycleListeners.willAfterAllListeners.push(cb);
36
+ }
37
+ static onDidCallAfterAll(cb) {
38
+ TestLifecycleListeners.didAfterAllListeners.push(cb);
39
+ }
40
+ }
1
41
  export class TestLifecycleListeners {
2
42
  static async emitWillRunBeforeAll() {
3
43
  for (const cb of this.willBeforeAllListeners) {
@@ -48,43 +88,3 @@ TestLifecycleListeners.willAfterEachListeners = [];
48
88
  TestLifecycleListeners.didAfterEachListeners = [];
49
89
  TestLifecycleListeners.willAfterAllListeners = [];
50
90
  TestLifecycleListeners.didAfterAllListeners = [];
51
- export default class SpruceTestResolver {
52
- static resolveTestClass(target) {
53
- if (!this.__activeTest) {
54
- this.__activeTest = this.ActiveTestClass
55
- ? new this.ActiveTestClass()
56
- : target;
57
- }
58
- return this.__activeTest;
59
- }
60
- static getActiveTest() {
61
- return this.__activeTest;
62
- }
63
- static reset() {
64
- delete this.__activeTest;
65
- }
66
- static onWillCallBeforeAll(cb) {
67
- TestLifecycleListeners.willBeforeAllListeners.push(cb);
68
- }
69
- static onDidCallBeforeAll(cb) {
70
- TestLifecycleListeners.didBeforeAllListeners.push(cb);
71
- }
72
- static onWillCallBeforeEach(cb) {
73
- TestLifecycleListeners.willBeforeEachListeners.push(cb);
74
- }
75
- static onDidCallBeforeEach(cb) {
76
- TestLifecycleListeners.didBeforeEachListeners.push(cb);
77
- }
78
- static onWillCallAfterEach(cb) {
79
- TestLifecycleListeners.willAfterEachListeners.push(cb);
80
- }
81
- static onDidCallAfterEach(cb) {
82
- TestLifecycleListeners.didAfterEachListeners.push(cb);
83
- }
84
- static onWillCallAfterAll(cb) {
85
- TestLifecycleListeners.willAfterAllListeners.push(cb);
86
- }
87
- static onDidCallAfterAll(cb) {
88
- TestLifecycleListeners.didAfterAllListeners.push(cb);
89
- }
90
- }
@@ -10,3 +10,5 @@ export { default as assertUtil } from './assert/assert.utility';
10
10
  export { default as StackCleaner } from './StackCleaner';
11
11
  export { default as Spier } from './utilities/spies/Spier';
12
12
  export { default as Spy } from './utilities/spies/Spy';
13
+ export { default as SpruceTestResolver } from './SpruceTestResolver';
14
+ export * from './SpruceTestResolver';
@@ -10,3 +10,5 @@ export { default as assertUtil } from './assert/assert.utility.js';
10
10
  export { default as StackCleaner } from './StackCleaner.js';
11
11
  export { default as Spier } from './utilities/spies/Spier.js';
12
12
  export { default as Spy } from './utilities/spies/Spy.js';
13
+ export { default as SpruceTestResolver } from './SpruceTestResolver.js';
14
+ export * from './SpruceTestResolver.js';
package/build/index.d.ts CHANGED
@@ -10,3 +10,5 @@ export { default as assertUtil } from './assert/assert.utility';
10
10
  export { default as StackCleaner } from './StackCleaner';
11
11
  export { default as Spier } from './utilities/spies/Spier';
12
12
  export { default as Spy } from './utilities/spies/Spy';
13
+ export { default as SpruceTestResolver } from './SpruceTestResolver';
14
+ export * from './SpruceTestResolver';
package/build/index.js CHANGED
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.Spy = exports.Spier = exports.StackCleaner = exports.assertUtil = exports.test = exports.assert = exports.default = exports.generateId = exports.errorAssertUtil = exports.errorAssert = void 0;
20
+ exports.SpruceTestResolver = exports.Spy = exports.Spier = exports.StackCleaner = exports.assertUtil = exports.test = exports.assert = exports.default = exports.generateId = exports.errorAssertUtil = exports.errorAssert = void 0;
21
21
  var errorAssert_1 = require("./utilities/errorAssert");
22
22
  Object.defineProperty(exports, "errorAssert", { enumerable: true, get: function () { return __importDefault(errorAssert_1).default; } });
23
23
  var errorAssert_utility_1 = require("./utilities/errorAssert.utility");
@@ -40,3 +40,6 @@ var Spier_1 = require("./utilities/spies/Spier");
40
40
  Object.defineProperty(exports, "Spier", { enumerable: true, get: function () { return __importDefault(Spier_1).default; } });
41
41
  var Spy_1 = require("./utilities/spies/Spy");
42
42
  Object.defineProperty(exports, "Spy", { enumerable: true, get: function () { return __importDefault(Spy_1).default; } });
43
+ var SpruceTestResolver_1 = require("./SpruceTestResolver");
44
+ Object.defineProperty(exports, "SpruceTestResolver", { enumerable: true, get: function () { return __importDefault(SpruceTestResolver_1).default; } });
45
+ __exportStar(require("./SpruceTestResolver"), exports);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "5.5.10",
6
+ "version": "5.5.11",
7
7
  "files": [
8
8
  "build"
9
9
  ],