@nestia/e2e 11.3.0 → 11.3.2

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.
@@ -37,7 +37,9 @@ export declare namespace DynamicExecutor {
37
37
  * Every prefixed function will be executed.
38
38
  *
39
39
  * In other words, if a function name doesn't start with the prefix, then it
40
- * would never be executed.
40
+ * would never be executed. Also, when a file name (basename) does not start
41
+ * with the prefix, the file would never be imported either, so that every
42
+ * function defined in the file would never be executed.
41
43
  */
42
44
  prefix: string;
43
45
  /** Location of the test functions. */
@@ -60,10 +62,15 @@ export declare namespace DynamicExecutor {
60
62
  /**
61
63
  * Filter function whether to run or not.
62
64
  *
63
- * @param name Function name
65
+ * The filter function is called with the file name (basename) of each
66
+ * dynamic function module, not with the function name. When it returns
67
+ * `false`, the file would never be imported, so that every function defined
68
+ * in the file would never be executed either.
69
+ *
70
+ * @param file File name (basename) of the dynamic functions
64
71
  * @returns Whether to run or not
65
72
  */
66
- filter?: (name: string) => boolean;
73
+ filter?: (file: string) => boolean;
67
74
  /**
68
75
  * Wrapper of test function.
69
76
  *
@@ -71,6 +71,8 @@ var DynamicExecutor;
71
71
  const processes = yield iterate({
72
72
  extension: (_a = props.extension) !== null && _a !== void 0 ? _a : "js",
73
73
  location: props.location,
74
+ prefix: props.prefix,
75
+ filter: props.filter,
74
76
  executor,
75
77
  });
76
78
  yield Promise.all(new Array((_b = props.simultaneous) !== null && _b !== void 0 ? _b : 1).fill(0).map(() => __awaiter(this, void 0, void 0, function* () {
@@ -82,6 +84,12 @@ var DynamicExecutor;
82
84
  report.time = Date.now() - report.time;
83
85
  return report;
84
86
  });
87
+ const specifier = (location) => {
88
+ const relative = path_1.default.relative(__dirname, path_1.default.resolve(location))
89
+ .split(path_1.default.sep)
90
+ .join("/");
91
+ return `./${relative}`;
92
+ };
85
93
  const iterate = (props) => __awaiter(this, void 0, void 0, function* () {
86
94
  const container = [];
87
95
  const visitor = (path) => __awaiter(this, void 0, void 0, function* () {
@@ -95,7 +103,17 @@ var DynamicExecutor;
95
103
  }
96
104
  else if (file.substr(-3) !== `.${props.extension}`)
97
105
  continue;
98
- const modulo = yield import(location);
106
+ else if (file.startsWith(props.prefix) === false)
107
+ continue;
108
+ else if (props.filter && props.filter(file) === false)
109
+ continue;
110
+ // Convert the absolute path to a POSIX relative specifier. It works
111
+ // both as a native ESM dynamic import (module: nodenext, which keeps
112
+ // `import()` as is) and as a `require()` call (module: commonjs, which
113
+ // downlevels `import()` to `require()`). A raw absolute path would
114
+ // break the native import on Windows (file URL scheme), and a `file://`
115
+ // URL would break the downleveled `require()`.
116
+ const modulo = yield import(specifier(location));
99
117
  container.push(() => props.executor(location, modulo));
100
118
  }
101
119
  });
@@ -105,8 +123,7 @@ var DynamicExecutor;
105
123
  const execute = (props) => (report) => (assert) => (location, modulo) => __awaiter(this, void 0, void 0, function* () {
106
124
  for (const [key, closure] of Object.entries(modulo)) {
107
125
  if (key.substring(0, props.prefix.length) !== props.prefix ||
108
- typeof closure !== "function" ||
109
- (props.filter && props.filter(key) === false))
126
+ typeof closure !== "function")
110
127
  continue;
111
128
  const func = () => {
112
129
  if (props.wrapper !== undefined)
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicExecutor.js","sourceRoot":"","sources":["../src/DynamicExecutor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,gDAA4B;AAE5B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,IAAiB,eAAe,CAyP/B;AAzPD,WAAiB,eAAe;IA0H9B;;;;;;;;;OASG;IACU,sBAAM,GAAG,CACpB,KAAwB,EACN,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;IAEzC;;;;;;;;;OASG;IACU,wBAAQ,GAAG,CACtB,KAAwB,EACN,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;IAE1C,MAAM,IAAI,GACR,CAAC,MAAe,EAAE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CAAC,CAAC;YAChD,CAAC,CAAC;YAEF,MAAM,MAAM,GAAe;gBACzB,IAAI,EAAE,GAAG;gBACT,QAAQ;gBACR,KAAK,EAAE,SAAS;gBAChB,KAAK,EAAE,IAAI;gBACX,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACvC,CAAC;YACF,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAE/B,IAAI,CAAC;gBACH,MAAM,CAAC,KAAK,GAAG,MAAM,IAAI,EAAE,CAAC;gBAC5B,MAAM,CAAC,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YACjD,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,CAAC,KAAK,GAAG,GAAY,CAAC;gBAC5B,IAAI,MAAM,KAAK,IAAI;oBAAE,MAAM,GAAG,CAAC;YACjC,CAAC;oBAAS,CAAC;gBACT,MAAM,CAAC,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;gBAC/C,IAAI,KAAK,CAAC,UAAU;oBAAE,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACjD,CAAC;QACH,CAAC;IACH,CAAC,CAAA,CAAC;AAKN,CAAC,EArRgB,eAAe,+BAAf,eAAe,QAqR/B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/e2e",
3
- "version": "11.3.0",
3
+ "version": "11.3.2",
4
4
  "description": "E2E test utilify functions",
5
5
  "main": "lib/index.js",
6
6
  "exports": {
@@ -41,7 +41,9 @@ export namespace DynamicExecutor {
41
41
  * Every prefixed function will be executed.
42
42
  *
43
43
  * In other words, if a function name doesn't start with the prefix, then it
44
- * would never be executed.
44
+ * would never be executed. Also, when a file name (basename) does not start
45
+ * with the prefix, the file would never be imported either, so that every
46
+ * function defined in the file would never be executed.
45
47
  */
46
48
  prefix: string;
47
49
 
@@ -68,10 +70,15 @@ export namespace DynamicExecutor {
68
70
  /**
69
71
  * Filter function whether to run or not.
70
72
  *
71
- * @param name Function name
73
+ * The filter function is called with the file name (basename) of each
74
+ * dynamic function module, not with the function name. When it returns
75
+ * `false`, the file would never be imported, so that every function defined
76
+ * in the file would never be executed either.
77
+ *
78
+ * @param file File name (basename) of the dynamic functions
72
79
  * @returns Whether to run or not
73
80
  */
74
- filter?: (name: string) => boolean;
81
+ filter?: (file: string) => boolean;
75
82
 
76
83
  /**
77
84
  * Wrapper of test function.
@@ -187,6 +194,8 @@ export namespace DynamicExecutor {
187
194
  const processes: Array<() => Promise<void>> = await iterate({
188
195
  extension: props.extension ?? "js",
189
196
  location: props.location,
197
+ prefix: props.prefix,
198
+ filter: props.filter,
190
199
  executor,
191
200
  });
192
201
  await Promise.all(
@@ -201,9 +210,21 @@ export namespace DynamicExecutor {
201
210
  return report;
202
211
  };
203
212
 
213
+ const specifier = (location: string): string => {
214
+ const relative: string = NodePath.relative(
215
+ __dirname,
216
+ NodePath.resolve(location),
217
+ )
218
+ .split(NodePath.sep)
219
+ .join("/");
220
+ return `./${relative}`;
221
+ };
222
+
204
223
  const iterate = async <Arguments extends any[]>(props: {
205
224
  location: string;
206
225
  extension: string;
226
+ prefix: string;
227
+ filter?: (file: string) => boolean;
207
228
  executor: (path: string, modulo: Module<Arguments>) => Promise<void>;
208
229
  }): Promise<Array<() => Promise<void>>> => {
209
230
  const container: Array<() => Promise<void>> = [];
@@ -217,8 +238,16 @@ export namespace DynamicExecutor {
217
238
  await visitor(location);
218
239
  continue;
219
240
  } else if (file.substr(-3) !== `.${props.extension}`) continue;
241
+ else if (file.startsWith(props.prefix) === false) continue;
242
+ else if (props.filter && props.filter(file) === false) continue;
220
243
 
221
- const modulo: Module<Arguments> = await import(location);
244
+ // Convert the absolute path to a POSIX relative specifier. It works
245
+ // both as a native ESM dynamic import (module: nodenext, which keeps
246
+ // `import()` as is) and as a `require()` call (module: commonjs, which
247
+ // downlevels `import()` to `require()`). A raw absolute path would
248
+ // break the native import on Windows (file URL scheme), and a `file://`
249
+ // URL would break the downleveled `require()`.
250
+ const modulo: Module<Arguments> = await import(specifier(location));
222
251
  container.push(() => props.executor(location, modulo));
223
252
  }
224
253
  };
@@ -234,8 +263,7 @@ export namespace DynamicExecutor {
234
263
  for (const [key, closure] of Object.entries(modulo)) {
235
264
  if (
236
265
  key.substring(0, props.prefix.length) !== props.prefix ||
237
- typeof closure !== "function" ||
238
- (props.filter && props.filter(key) === false)
266
+ typeof closure !== "function"
239
267
  )
240
268
  continue;
241
269