nole 2.1.2 → 2.2.0

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.
Files changed (49) hide show
  1. package/README.md +46 -0
  2. package/bin/nole.js +76 -61
  3. package/dist/data.js +2 -2
  4. package/dist/data.js.map +1 -1
  5. package/dist/decorators.d.ts +2 -1
  6. package/dist/decorators.d.ts.map +1 -1
  7. package/dist/decorators.js +51 -27
  8. package/dist/decorators.js.map +1 -1
  9. package/dist/index.d.ts +3 -3
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +3 -3
  12. package/dist/index.js.map +1 -1
  13. package/dist/run.d.ts.map +1 -1
  14. package/dist/run.js +40 -24
  15. package/dist/run.js.map +1 -1
  16. package/dist/test.d.ts.map +1 -1
  17. package/dist/utils/executor.js +1 -1
  18. package/dist/utils/executor.test.js +1 -1
  19. package/dist/utils/executor.test.js.map +1 -1
  20. package/dist/utils/time_difference.d.ts.map +1 -1
  21. package/dist/utils/time_difference.js.map +1 -1
  22. package/dist/utils/time_difference.test.js.map +1 -1
  23. package/dist/utils/time_factor.d.ts.map +1 -1
  24. package/dist/utils/time_factor.js +19 -14
  25. package/dist/utils/time_factor.js.map +1 -1
  26. package/dist/utils/time_factor.test.js +1 -1
  27. package/package.json +1 -1
  28. package/src/data.ts +3 -3
  29. package/src/decorators.ts +106 -48
  30. package/src/dynamic.ts +1 -1
  31. package/src/index.ts +13 -4
  32. package/src/run.ts +106 -42
  33. package/src/test.ts +10 -8
  34. package/src/utils/executor.test.ts +3 -3
  35. package/src/utils/executor.ts +2 -2
  36. package/src/utils/time_difference.test.ts +1 -1
  37. package/src/utils/time_difference.ts +1 -3
  38. package/src/utils/time_factor.test.ts +1 -1
  39. package/src/utils/time_factor.ts +24 -9
  40. package/test/basic.test.ts +8 -4
  41. package/test/before.test.ts +54 -0
  42. package/test/clean-up.test.ts +3 -5
  43. package/test/dynamic-skip.test.ts +1 -1
  44. package/test/dynamic.test.ts +1 -1
  45. package/test/hook.test.ts +3 -3
  46. package/test/multi-dependency.test.ts +31 -9
  47. package/test/multiple-uppercased-chars.test.ts +8 -7
  48. package/test/skip-all.test.ts +7 -7
  49. package/test/turkish-chars.test.ts +8 -7
package/README.md CHANGED
@@ -176,6 +176,52 @@ class Redis {
176
176
  }
177
177
  ```
178
178
 
179
+ ## Lazy multi Dependencies / after
180
+
181
+ Can solve order of execution issues
182
+
183
+ ```ts
184
+ // test/redis.test.ts
185
+ import { Spec, Dependencies, After } from 'nole';
186
+
187
+ @Dependencies(() => [ B ])
188
+ // or
189
+ // @After(() => [ B ])
190
+ class A {
191
+ b: B;
192
+
193
+ @Spec()
194
+ async DoThings() { }
195
+ }
196
+
197
+ class B {
198
+ @Spec()
199
+ async DoThings() { }
200
+ }
201
+ ```
202
+
203
+ ## Reverse dependency / dependent / before
204
+
205
+
206
+
207
+ ```ts
208
+ // test/redis.test.ts
209
+ import { Spec, Dependents, Before } from 'nole';
210
+
211
+ class A {
212
+ b: B;
213
+
214
+ @Spec()
215
+ async DoThings() { }
216
+ }
217
+
218
+ @Before(() => [ A ])
219
+ class B {
220
+ @Spec()
221
+ async DoThings() { }
222
+ }
223
+ ```
224
+
179
225
  ## Hook
180
226
 
181
227
  Hooks will help you to develop helper methods.
package/bin/nole.js CHANGED
@@ -1,86 +1,101 @@
1
1
  #!/usr/bin/env node --loader=ts-node/esm
2
2
 
3
- import program from 'commander';
4
- import glob from 'glob';
5
- import path from 'path';
6
- import fs from 'fs';
7
- import colors from 'colors/safe.js';
8
- import { ManualRun } from '../dist/run.js';
9
- import { TimeDifference } from '../dist/utils/time_difference.js';
10
- import { TimeResolve } from '../dist/utils/time_factor.js';
11
-
12
- const pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url)).toString())
3
+ import program from "commander";
4
+ import glob from "glob";
5
+ import path from "path";
6
+ import fs from "fs";
7
+ import colors from "colors/safe.js";
8
+ import { ManualRun } from "../dist/run.js";
9
+ import { TimeDifference } from "../dist/utils/time_difference.js";
10
+ import { Delay, TimeResolve } from "../dist/utils/time_factor.js";
11
+
12
+ const pkg = JSON.parse(
13
+ fs.readFileSync(new URL("../package.json", import.meta.url)).toString()
14
+ );
13
15
 
14
16
  program
15
- .usage('<glob> ...')
16
- .option('-L, --no-log', 'disable console.log')
17
- .option('-O, --order-debug', 'shows execution order')
17
+ .usage("<glob> ...")
18
+ .option("-L, --no-log", "disable console.log")
19
+ .option("-O, --order-debug", "shows execution order")
18
20
  .version(pkg.version)
19
21
  .parse(process.argv);
20
22
 
21
-
22
23
  if (!program.args.length) {
23
- program.help()
24
+ program.help();
24
25
  } else {
25
26
  let time = TimeDifference.begin();
26
27
 
27
28
  let log = console.log.bind(console);
28
29
 
29
30
  if (!program.log) {
30
- console.log = function () { }
31
+ console.log = function () {};
31
32
  }
32
33
 
33
- Promise.all(program.args.map(arg => new Promise((resolve, reject) => {
34
- glob(arg, (err, matches) => {
35
- if (err) {
36
- return reject(err);
34
+ Promise.all(
35
+ program.args.map(
36
+ (arg) =>
37
+ new Promise((resolve, reject) => {
38
+ glob(arg, (err, matches) => {
39
+ if (err) {
40
+ return reject(err);
41
+ }
42
+
43
+ resolve(matches);
44
+ });
45
+ })
46
+ )
47
+ )
48
+ .then(async (list) => {
49
+ const fileList = [];
50
+
51
+ for (const item of list) {
52
+ while (item.length)
53
+ fileList.push(path.resolve(process.cwd(), item.pop()));
37
54
  }
38
55
 
39
- resolve(matches);
40
- })
41
- }))).then(async list => {
42
- let fileList = [];
43
-
44
- for (let item of list) {
45
- while (item.length) fileList.push(path.resolve(process.cwd(), item.pop()));
46
- }
47
-
48
- if (!fileList.length) {
49
- failed('0 files found');
50
- process.exit(1);
51
- }
52
-
53
- let file = time.end();
54
-
55
- for (let file of fileList) {
56
- await import(`file://${file}`);
57
- }
56
+ if (!fileList.length) {
57
+ failed("0 files found");
58
+ process.exit(1);
59
+ }
58
60
 
59
- let prop = time.end();
61
+ const file = time.end();
60
62
 
61
- log('Nole tests v' + pkg.version);
62
- try {
63
- await ManualRun({
64
- log,
65
- orderDebug: program.orderDebug
66
- });
63
+ for (const file of fileList) {
64
+ await import(`file://${file}`);
65
+ }
67
66
 
68
- log(' discover: %s', TimeResolve(file))
69
- log(' resolve: %s', TimeResolve(prop - file))
70
- log(' tests: %s', TimeResolve(time.end() - prop))
71
- process.exit(0);
72
- } catch (e) {
73
- console.error(e);
67
+ const prop = time.end();
68
+
69
+ const dependencyResolveWaitPeriod = process.env.NOLE_WAIT_PERIOD || 500;
70
+
71
+ log("Nole tests v" + pkg.version);
72
+ try {
73
+ await Delay(dependencyResolveWaitPeriod);
74
+
75
+ await ManualRun({
76
+ log,
77
+ orderDebug: program.orderDebug,
78
+ });
79
+
80
+ log(" discover: %s", TimeResolve(file));
81
+ log(" resolve: %s", TimeResolve(prop - file));
82
+ log(
83
+ " tests: %s",
84
+ TimeResolve(time.end() - prop - dependencyResolveWaitPeriod)
85
+ );
86
+ process.exit(0);
87
+ } catch (e) {
88
+ console.error(e);
89
+ process.exit(1);
90
+ }
91
+ })
92
+ .catch((e) => {
93
+ failed("Error occurred on resolving files");
94
+ console.error(e.stack || e);
74
95
  process.exit(1);
75
- }
76
- }).catch(e => {
77
- failed('Error occurred on resolving files');
78
- console.error(e.stack || e);
79
- process.exit(1);
80
- })
96
+ });
81
97
  }
82
98
 
83
-
84
99
  function failed(message) {
85
- console.error(colors.bold(colors.red(' (failed) ' + message)))
86
- }
100
+ console.error(colors.bold(colors.red(" (failed) " + message)));
101
+ }
package/dist/data.js CHANGED
@@ -1,9 +1,9 @@
1
- const KEY = '_nole_hash';
1
+ const KEY = "_nole_hash";
2
2
  export function HashMap() {
3
3
  let g = global;
4
4
  if (g[KEY]) {
5
5
  return g[KEY];
6
6
  }
7
- return g[KEY] = new Map();
7
+ return (g[KEY] = new Map());
8
8
  }
9
9
  //# sourceMappingURL=data.js.map
package/dist/data.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"data.js","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAEA,MAAM,GAAG,GAAG,YAAY,CAAC;AAEzB,MAAM,UAAU,OAAO;IACrB,IAAI,CAAC,GAAQ,MAAM,CAAC;IAEpB,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE;QACV,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;KACf;IAED,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,EAAa,CAAC;AACvC,CAAC"}
1
+ {"version":3,"file":"data.js","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAEA,MAAM,GAAG,GAAG,YAAY,CAAC;AAEzB,MAAM,UAAU,OAAO;IACrB,IAAI,CAAC,GAAQ,MAAM,CAAC;IAEpB,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE;QACV,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;KACf;IAED,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,EAAa,CAAC,CAAC;AACzC,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import { HookType, ClassDefition } from "./test.js";
2
2
  export declare function Spec(timeout?: number): MethodDecorator;
3
3
  export declare function Dependency<T>(dependency: ClassDefition<T>): PropertyDecorator;
4
- export declare function Dependencies(dependencies: ClassDefition<any>[]): ClassDecorator;
4
+ export declare function Dependencies(dependencies: (() => ClassDefition<any>[]) | ClassDefition<any>[]): ClassDecorator;
5
+ export declare function Dependents(dependents: (() => ClassDefition<any>[]) | ClassDefition<any>[]): ClassDecorator;
5
6
  export declare function Hook(type: HookType, timeout?: number): MethodDecorator;
6
7
  export declare function Skip(reason?: string): MethodDecorator;
7
8
  export declare function SkipClass(reason?: string): ClassDecorator;
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAO1D,wBAAgB,IAAI,CAAC,O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E,MAAM,GAAG,cAAc,CAIzD"}
@@ -13,14 +13,24 @@ export function Dependency(dependency) {
13
13
  }
14
14
  export function Dependencies(dependencies) {
15
15
  return function (target) {
16
- for (const dependency of dependencies) {
17
- const propertyKey = camelcase(dependency.name, {
18
- preserveConsecutiveUppercase: process.env.NOLE_PRESERVE_CONSECUTIVE_UPPERCASE == undefined ? true : (process.env.NOLE_PRESERVE_CONSECUTIVE_UPPERCASE === 'true'),
19
- pascalCase: process.env.NOLE_PASCALCASE == undefined ? false : (process.env.NOLE_PASCALCASE === 'true'),
20
- locale: 'en-US'
21
- });
22
- DeclareDependencyForTestClass({ constructor: target }, propertyKey, dependency);
23
- }
16
+ setImmediate(() => {
17
+ const value = isFunction(dependencies) ? dependencies() : dependencies;
18
+ for (const dependency of value) {
19
+ const propertyKey = validPropertyName(dependency.name);
20
+ DeclareDependencyForTestClass({ constructor: target }, propertyKey, dependency);
21
+ }
22
+ });
23
+ };
24
+ }
25
+ export function Dependents(dependents) {
26
+ return function (target) {
27
+ setImmediate(() => {
28
+ const value = isFunction(dependents) ? dependents() : dependents;
29
+ for (const dependent of value) {
30
+ const propertyKey = validPropertyName(target.name);
31
+ DeclareDependencyForTestClass({ constructor: dependent }, propertyKey, target);
32
+ }
33
+ });
24
34
  };
25
35
  }
26
36
  export function Hook(type, timeout = 5000) {
@@ -30,57 +40,57 @@ export function Hook(type, timeout = 5000) {
30
40
  }
31
41
  export function Skip(reason) {
32
42
  return function (target, propertyKey) {
33
- DeclareAsSkipped(target, propertyKey, reason ? reason : '');
43
+ DeclareAsSkipped(target, propertyKey, reason ? reason : "");
34
44
  };
35
45
  }
36
46
  export function SkipClass(reason) {
37
47
  return function (target) {
38
- DeclareAsSkippedClass(target, reason ? reason : '');
48
+ DeclareAsSkippedClass(target, reason ? reason : "");
39
49
  };
40
50
  }
41
51
  function GetTestInstanceOfTarget(target) {
42
52
  let instance = HashMap().get(target);
43
53
  if (!instance) {
44
- HashMap().set(target, instance = new Test(target));
54
+ HashMap().set(target, (instance = new Test(target)));
45
55
  }
46
56
  return instance;
47
57
  }
48
58
  function DeclareDependencyForTestClass(protoOfTarget, propertyKey, dependency) {
49
- let target = protoOfTarget.constructor;
50
- let test = GetTestInstanceOfTarget(target);
51
- let depTest = GetTestInstanceOfTarget(dependency);
59
+ const target = protoOfTarget.constructor;
60
+ const test = GetTestInstanceOfTarget(target);
61
+ const depTest = GetTestInstanceOfTarget(dependency);
52
62
  test.dependencies.push({ propertyKey, dependency: depTest });
53
63
  depTest.dependents.push(test);
54
64
  }
55
65
  function DeclareSpecForTestClass(protoOfTarget, propertyKey, timeout) {
56
- let target = protoOfTarget.constructor;
57
- let test = GetTestInstanceOfTarget(target);
66
+ const target = protoOfTarget.constructor;
67
+ const test = GetTestInstanceOfTarget(target);
58
68
  if (test.hooks.has(propertyKey)) {
59
- throw new Error('@Hook cannot be used with @Spec! Test: ');
69
+ throw new Error("@Hook cannot be used with @Spec! Test: ");
60
70
  }
61
71
  if (test.specs.has(propertyKey)) {
62
- throw new Error('Multiple @Spec for a single method is prohibited');
72
+ throw new Error("Multiple @Spec for a single method is prohibited");
63
73
  }
64
74
  test.specs.set(propertyKey, { timeout });
65
75
  }
66
76
  function DeclareHookForTestClass(protoOfTarget, propertyKey, hookType, timeout) {
67
- let target = protoOfTarget.constructor;
68
- let test = GetTestInstanceOfTarget(target);
77
+ const target = protoOfTarget.constructor;
78
+ const test = GetTestInstanceOfTarget(target);
69
79
  if (test.specs.has(propertyKey)) {
70
- throw new Error('@Hook cannot be used with @Spec');
80
+ throw new Error("@Hook cannot be used with @Spec");
71
81
  }
72
82
  if (test.hooks.has(propertyKey)) {
73
- throw new Error('Multiple @Hook for a single method is prohibited');
83
+ throw new Error("Multiple @Hook for a single method is prohibited");
74
84
  }
75
85
  test.hooks.set(propertyKey, { type: hookType, timeout });
76
86
  }
77
87
  function DeclareAsSkipped(protoOfTarget, propertyKey, reason) {
78
- let target = protoOfTarget.constructor;
79
- let test = GetTestInstanceOfTarget(target);
88
+ const target = protoOfTarget.constructor;
89
+ const test = GetTestInstanceOfTarget(target);
80
90
  if (test.skip.has(propertyKey)) {
81
- let obj = test.skip.get(propertyKey);
91
+ const obj = test.skip.get(propertyKey);
82
92
  if (reason) {
83
- obj.reason = (obj.reason ? obj.reason + ', ' : '') + reason;
93
+ obj.reason = (obj.reason ? obj.reason + ", " : "") + reason;
84
94
  }
85
95
  }
86
96
  else {
@@ -88,7 +98,21 @@ function DeclareAsSkipped(protoOfTarget, propertyKey, reason) {
88
98
  }
89
99
  }
90
100
  function DeclareAsSkippedClass(target, reason) {
91
- let test = GetTestInstanceOfTarget(target);
101
+ const test = GetTestInstanceOfTarget(target);
92
102
  test.skipClass = { reason };
93
103
  }
104
+ function validPropertyName(name) {
105
+ return camelcase(name, {
106
+ preserveConsecutiveUppercase: process.env.NOLE_PRESERVE_CONSECUTIVE_UPPERCASE == undefined
107
+ ? true
108
+ : process.env.NOLE_PRESERVE_CONSECUTIVE_UPPERCASE === "true",
109
+ pascalCase: process.env.NOLE_PASCALCASE == undefined
110
+ ? false
111
+ : process.env.NOLE_PASCALCASE === "true",
112
+ locale: "en-US",
113
+ });
114
+ }
115
+ function isFunction(thing) {
116
+ return typeof thing !== "object" && typeof thing === "function";
117
+ }
94
118
  //# sourceMappingURL=decorators.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAA2B,MAAM,WAAW,CAAC;AAC1D,OAAO,SAAS,MAAM,WAAW,CAAC;AAMlC,MAAM,UAAU,IAAI,CAAC,UAAkB,IAAI;IACzC,OAAO,UAAU,MAAM,EAAE,WAAW;QAClC,uBAAuB,CAAC,MAAM,EAAU,WAAW,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC,CAAA;AACH,CAAC;AAOD,MAAM,UAAU,UAAU,CAAI,UA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AC,OAAO,CAAC,GAAG,CAAC,mCAAmC,KAAK,MAAM;QAEhE,UAAU,EACR,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,SAAS;YACtC,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,MAAM;QAE5C,MAAM,EAAE,OAAO;KAChB,CAAC,CAAC;AACL,CAAC;AAED,SAAS,UAAU,CAAC,KAAU;IAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,UAAU,CAAC;AAClE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { Dependency, Spec, Hook, Skip, SkipClass, Dependencies } from './decorators.js';
2
- export { HookType } from './test.js';
3
- export { skipTest } from './dynamic.js';
1
+ export { Dependency, Spec, Hook, Skip, SkipClass, Dependencies, Dependencies as After, Dependents as Before, Dependents, } from "./decorators.js";
2
+ export { HookType } from "./test.js";
3
+ export { skipTest } from "./dynamic.js";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,YAAY,IAAI,KAAK,EACrB,UAAU,IAAI,MAAM,EACpB,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { Dependency, Spec, Hook, Skip, SkipClass, Dependencies } from './decorators.js';
2
- export { HookType } from './test.js';
3
- export { skipTest } from './dynamic.js';
1
+ export { Dependency, Spec, Hook, Skip, SkipClass, Dependencies, Dependencies as After, Dependents as Before, Dependents, } from "./decorators.js";
2
+ export { HookType } from "./test.js";
3
+ export { skipTest } from "./dynamic.js";
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,YAAY,IAAI,KAAK,EACrB,UAAU,IAAI,MAAM,EACpB,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
package/dist/run.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAeA,UAAU,OAAO;IACf,GAAG,EAAE,QAAQ,CAAC;IACd,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,iBA2CzC"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAeA,UAAU,OAAO;IACf,GAAG,EAAE,QAAQ,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,iBA2CzC"}
package/dist/run.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { HashMap } from "./data.js";
2
2
  import { TimeDifference } from "./utils/time_difference.js";
3
3
  import { TimeFactor } from "./utils/time_factor.js";
4
- import * as clrs from 'colors/safe.js';
4
+ import * as clrs from "colors/safe.js";
5
5
  import { Executor } from "./utils/executor.js";
6
6
  import { HookType } from "./test.js";
7
7
  const colors = clrs.default;
8
- const OK_TEXT = colors.bold(colors.green(' (ok) '));
9
- const SKIP_TEXT = colors.bold(colors.yellow(' (skip) '));
10
- const DYNAMIC_SKIP_TEXT = colors.bold(colors.blue(' (dskip) '));
11
- const FAILED_TEXT = colors.bold(colors.red(' (failed) '));
12
- const HOOK_FAILED_TEXT = colors.bold(colors.red(' (hook failed) '));
8
+ const OK_TEXT = colors.bold(colors.green(" (ok) "));
9
+ const SKIP_TEXT = colors.bold(colors.yellow(" (skip) "));
10
+ const DYNAMIC_SKIP_TEXT = colors.bold(colors.blue(" (dskip) "));
11
+ const FAILED_TEXT = colors.bold(colors.red(" (failed) "));
12
+ const HOOK_FAILED_TEXT = colors.bold(colors.red(" (hook failed) "));
13
13
  export function ManualRun(options) {
14
14
  if (!options.log) {
15
15
  options.log = console.log.bind(console);
@@ -20,7 +20,7 @@ export function ManualRun(options) {
20
20
  let hashMap = new Map(HashMap());
21
21
  if (!hashMap.size) {
22
22
  log(`${FAILED_TEXT} no specs found`);
23
- throw new Error('No specs found');
23
+ throw new Error("No specs found");
24
24
  }
25
25
  while (hashMap.size) {
26
26
  let test = PickNextTestFromHashMap(hashMap);
@@ -51,26 +51,28 @@ function PickNextTestFromHashMap(hashMap) {
51
51
  for (let test of hashMap.values()) {
52
52
  if (test.isFinished)
53
53
  continue;
54
- if (!test.dependencies.every(x => x.dependency.isFinished))
54
+ if (!test.dependencies.every((x) => x.dependency.isFinished))
55
55
  continue;
56
56
  return test;
57
57
  }
58
58
  }
59
59
  function CreateInstanceIfNotExists(test) {
60
60
  if (!test.testInstance) {
61
- test.testInstance = new (test.target);
61
+ test.testInstance = new test.target();
62
62
  }
63
63
  }
64
64
  function HandleDependencies(test) {
65
65
  for (let dependency of test.dependencies) {
66
- test.testInstance[dependency.propertyKey] = dependency.dependency.testInstance;
66
+ test.testInstance[dependency.propertyKey] =
67
+ dependency.dependency.testInstance;
67
68
  }
68
69
  }
69
70
  async function HandleBeforeHooks(test, options) {
70
71
  for (let [propertyKey, hook] of test.hooks.entries()) {
71
72
  if (hook.type != HookType.Before)
72
73
  continue;
73
- let hookName = colors.bold(colors.yellow(test.name + (propertyKey != 'before' ? `.${propertyKey}:before` : ':before')));
74
+ let hookName = colors.bold(colors.yellow(test.name +
75
+ (propertyKey != "before" ? `.${propertyKey}:before` : ":before")));
74
76
  try {
75
77
  if (!options.orderDebug) {
76
78
  await Executor(test.testInstance[propertyKey].bind(test.testInstance), hook.timeout);
@@ -91,7 +93,10 @@ async function HandleBeforeEachHooks(test, options) {
91
93
  for (let [propertyKey, hook] of test.hooks.entries()) {
92
94
  if (hook.type != HookType.BeforeEach)
93
95
  continue;
94
- let hookName = colors.bold(colors.yellow(test.name + (propertyKey != 'beforeEach' ? `.${propertyKey}:beforeEach` : ':beforeEach')));
96
+ let hookName = colors.bold(colors.yellow(test.name +
97
+ (propertyKey != "beforeEach"
98
+ ? `.${propertyKey}:beforeEach`
99
+ : ":beforeEach")));
95
100
  try {
96
101
  if (!options.orderDebug) {
97
102
  await Executor(test.testInstance[propertyKey].bind(test.testInstance), hook.timeout);
@@ -112,7 +117,10 @@ async function HandleAfterEachHooks(test, options) {
112
117
  for (let [propertyKey, hook] of test.hooks.entries()) {
113
118
  if (hook.type != HookType.AfterEach)
114
119
  continue;
115
- let hookName = colors.bold(colors.yellow(test.name + (propertyKey != 'afterEach' ? `.${propertyKey}:afterEach` : ':afterEach')));
120
+ let hookName = colors.bold(colors.yellow(test.name +
121
+ (propertyKey != "afterEach"
122
+ ? `.${propertyKey}:afterEach`
123
+ : ":afterEach")));
116
124
  try {
117
125
  if (!options.orderDebug) {
118
126
  await Executor(test.testInstance[propertyKey].bind(test.testInstance), hook.timeout);
@@ -132,11 +140,13 @@ async function HandleAfterEachHooks(test, options) {
132
140
  async function HandleSpecs(test, options) {
133
141
  const log = options.log;
134
142
  for (let [propertyKey, spec] of test.specs.entries()) {
135
- let testName = colors.bold(colors.yellow(test.name + '.' + propertyKey));
143
+ let testName = colors.bold(colors.yellow(test.name + "." + propertyKey));
136
144
  const shouldPropertySkip = test.skip.has(propertyKey);
137
145
  if (shouldPropertySkip || test.skipClass) {
138
- let reason = shouldPropertySkip ? test.skip.get(propertyKey).reason : test.skipClass.reason;
139
- log(`${SKIP_TEXT} ${' '.repeat(9)} ${testName}() ${reason ? '{' + reason + '}' : ''}`);
146
+ let reason = shouldPropertySkip
147
+ ? test.skip.get(propertyKey).reason
148
+ : test.skipClass.reason;
149
+ log(`${SKIP_TEXT} ${" ".repeat(9)} ${testName}() ${reason ? "{" + reason + "}" : ""}`);
140
150
  continue;
141
151
  }
142
152
  await HandleBeforeEachHooks(test, options);
@@ -151,7 +161,7 @@ async function HandleSpecs(test, options) {
151
161
  catch (e) {
152
162
  if (e?._nole_anchor) {
153
163
  let reason = e.reason;
154
- log(`${DYNAMIC_SKIP_TEXT} ${' '.repeat(8)} ${testName}() ${reason ? '{' + reason + '}' : ''}`);
164
+ log(`${DYNAMIC_SKIP_TEXT} ${" ".repeat(8)} ${testName}() ${reason ? "{" + reason + "}" : ""}`);
155
165
  continue;
156
166
  }
157
167
  let timeText = TimeFactor(start.end(), spec.timeout);
@@ -166,7 +176,8 @@ async function HandleAfterHooks(test, options) {
166
176
  for (let [propertyKey, hook] of test.hooks.entries()) {
167
177
  if (hook.type != HookType.After)
168
178
  continue;
169
- let hookName = colors.bold(colors.yellow(test.name + (propertyKey != 'after' ? `.${propertyKey}:after` : ':after')));
179
+ let hookName = colors.bold(colors.yellow(test.name +
180
+ (propertyKey != "after" ? `.${propertyKey}:after` : ":after")));
170
181
  try {
171
182
  if (!options.orderDebug) {
172
183
  await Executor(test.testInstance[propertyKey].bind(test.testInstance), hook.timeout);
@@ -186,14 +197,15 @@ async function HandleAfterHooks(test, options) {
186
197
  async function HandleCleanUp(test, options) {
187
198
  if (test.cleanUpCalled)
188
199
  return;
189
- if (!test.dependents.every(dependent => dependent.isFinished && dependent.cleanUpCalled))
200
+ if (!test.dependents.every((dependent) => dependent.isFinished && dependent.cleanUpCalled))
190
201
  return;
191
202
  test.cleanUpCalled = true;
192
203
  const log = options.log;
193
204
  for (let [propertyKey, hook] of test.hooks.entries()) {
194
205
  if (hook.type != HookType.CleanUp)
195
206
  continue;
196
- let hookName = colors.bold(colors.yellow(test.name + (propertyKey != 'cleanUp' ? `.${propertyKey}:cleanUp` : ':cleanUp')));
207
+ let hookName = colors.bold(colors.yellow(test.name +
208
+ (propertyKey != "cleanUp" ? `.${propertyKey}:cleanUp` : ":cleanUp")));
197
209
  let start = TimeDifference.begin();
198
210
  try {
199
211
  if (!options.orderDebug) {
@@ -213,11 +225,15 @@ async function HandleCleanUp(test, options) {
213
225
  }
214
226
  }
215
227
  function DependencyLock(hashMap) {
216
- console.error(FAILED_TEXT + colors.red('Looks like there is confict issue for dependency resolving!'));
217
- console.error('Possible conflicts;');
228
+ console.error(FAILED_TEXT +
229
+ colors.red("Looks like there is confict issue for dependency resolving!"));
230
+ console.error("Possible conflicts;");
218
231
  for (let test of hashMap.values()) {
219
- console.error(`- class ${test.name} { ${test.dependencies.filter(x => !x.dependency.isFinished).map(x => `@Dependency(${x.dependency.name}) ${x.propertyKey}`).join(', ')} }`);
232
+ console.error(`- class ${test.name} { ${test.dependencies
233
+ .filter((x) => !x.dependency.isFinished)
234
+ .map((x) => `@Dependency(${x.dependency.name}) ${x.propertyKey}`)
235
+ .join(", ")} }`);
220
236
  }
221
- throw new Error('Dependency lock occurred!');
237
+ throw new Error("Dependency lock occurred!");
222
238
  }
223
239
  //# sourceMappingURL=run.js.map