@nestia/e2e 0.7.0 → 0.8.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.
package/README.md CHANGED
@@ -2,21 +2,28 @@
2
2
  ![Nestia Logo](https://nestia.io/logo.png)
3
3
 
4
4
  [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE)
5
- [![npm version](https://img.shields.io/npm/v/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)
6
- [![Downloads](https://img.shields.io/npm/dm/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)
5
+ [![npm version](https://img.shields.io/npm/v/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher)
6
+ [![Downloads](https://img.shields.io/npm/dm/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher)
7
7
  [![Build Status](https://github.com/samchon/nestia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild)
8
- [![Guide Documents](https://img.shields.io/badge/guide-documents-forestgreen)](https://nestia.io/docs/)
8
+ [![Guide Documents](https://img.shields.io/badge/Guide-Documents-forestgreen)](https://nestia.io/docs/)
9
+ [![Gurubase](https://img.shields.io/badge/Gurubase-Document%20Chatbot-006BFF)](https://gurubase.io/g/nestia)
10
+ [![Discord Badge](https://img.shields.io/badge/discord-samchon-d91965?style=flat&labelColor=5866f2&logo=discord&logoColor=white&link=https://discord.gg/E94XhzrUCZ)](https://discord.gg/E94XhzrUCZ)
9
11
 
10
12
  Nestia is a set of helper libraries for NestJS, supporting below features:
11
13
 
12
- - `@nestia/core`: super-fast decorators
14
+ - `@nestia/core`:
15
+ - Super-fast/easy decorators
16
+ - Advanced WebSocket routes
13
17
  - `@nestia/sdk`:
14
- - Swagger generator evolved than ever
18
+ - Swagger generator, more evolved than ever
15
19
  - SDK library generator for clients
16
20
  - Mockup Simulator for client applications
17
21
  - Automatic E2E test functions generator
18
- - `@nestia/migrate`: migration from Swagger to NestJS
19
- - `nestia`: just CLI (command line interface) tool
22
+ - `@nestia/e2e`: Test program utilizing e2e test functions
23
+ - `@nestia/benchmark`: Benchmark program using e2e test functions
24
+ - `@nestia/chat`: Super A.I. Chatbot by Swagger document
25
+ - `@nestia/editor`: Swagger-UI with Online TypeScript Editor
26
+ - `nestia`: Just CLI (command line interface) tool
20
27
 
21
28
  > [!NOTE]
22
29
  >
@@ -25,8 +32,8 @@ Nestia is a set of helper libraries for NestJS, supporting below features:
25
32
  > - Runtime validator is **20,000x faster** than `class-validator`
26
33
  > - JSON serialization is **200x faster** than `class-transformer`
27
34
  > - Software Development Kit
28
- > - SDK is a collection of `fetch` functions with type definitions like [tRPC](https://trpc.io/)
29
- > - Mockup simulator means embedded backend simulator in SDK
35
+ > - Collection of typed `fetch` functions with DTO structures like [tRPC](https://trpc.io/)
36
+ > - Mockup simulator means embedded backend simulator in the SDK
30
37
  > - similar with [msw](https://mswjs.io/), but fully automated
31
38
 
32
39
  ![nestia-sdk-demo](https://user-images.githubusercontent.com/13158709/215004990-368c589d-7101-404e-b81b-fbc936382f05.gif)
@@ -56,19 +63,30 @@ Check out the document in the [website](https://nestia.io/docs/):
56
63
 
57
64
  ### 📖 Features
58
65
  - Core Library
59
- - [TypedRoute](https://nestia.io/docs/core/TypedRoute/)
60
- - [TypedBody](https://nestia.io/docs/core/TypedBody/)
61
- - [TypedParam](https://nestia.io/docs/core/TypedParam/)
62
- - [TypedQuery](https://nestia.io/docs/core/TypedRoute/)
63
- - [TypedHeaders](https://nestia.io/docs/core/TypedHeaders/)
64
- - [TypedException](https://nestia.io/docs/core/TypedException/)
65
- - Generators
66
- - [Swagger Documents](https://nestia.io/docs/sdk/swagger/)
67
- - [SDK Library](https://nestia.io/docs/sdk/sdk/)
68
- - [E2E Functions](https://nestia.io/docs/sdk/e2e/)
69
- - [Mockup Simulator](https://nestia.io/docs/sdk/simulator/)
70
- - [Swagger to NestJS](https://nestia.io/docs/migrate/)
66
+ - [`@WebSocketRoute`](https://nestia.io/docs/core/WebSocketRoute)
67
+ - [`@TypedRoute`](https://nestia.io/docs/core/TypedRoute/)
68
+ - [**`@TypedBody`**](https://nestia.io/docs/core/TypedBody/)
69
+ - [`@TypedParam`](https://nestia.io/docs/core/TypedParam/)
70
+ - [`@TypedQuery`](https://nestia.io/docs/core/TypedQuery/)
71
+ - [`@TypedFormData`](https://nestia.io/docs/core/TypedFormData/)
72
+ - [`@TypedHeaders`](https://nestia.io/docs/core/TypedHeaders/)
73
+ - [`@TypedException`](https://nestia.io/docs/core/TypedException/)
74
+ - Software Development Kit
75
+ - [SDK Builder](https://nestia.io/docs/sdk/)
76
+ - [Mockup Simulator](https://nestia.io/docs/sdk/simulate/)
77
+ - [E2E Test Functions](https://nestia.io/docs/sdk/e2e/)
78
+ - [Distribution](https://nestia.io/docs/sdk/distribute/)
79
+ - Swagger Document
80
+ - [Swagger Builder](https://nestia.io/docs/swagger/)
81
+ - [**AI Chatbot Development**](https://nestia.io/docs/swagger/chat/)
82
+ - [Cloud Swagger Editor](https://nestia.io/docs/swagger/editor/)
83
+ - [Documentation Strategy](https://nestia.io/docs/swagger/strategy/)
84
+ - E2E Testing
85
+ - [Why E2E Test?](https://nestia.io/docs/e2e/why/)
86
+ - [Test Program Development](https://nestia.io/docs/e2e/development/)
87
+ - [Performance Benchmark](https://nestia.io/docs/e2e/benchmark/)
71
88
 
72
89
  ### 🔗 Appendix
90
+ - [API Documents](https://nestia.io/api)
73
91
  - [⇲ Benchmark Result](https://github.com/samchon/nestia/tree/master/benchmark/results/11th%20Gen%20Intel(R)%20Core(TM)%20i5-1135G7%20%40%202.40GHz)
74
92
  - [⇲ `dev.to` Articles](https://dev.to/samchon/series/22751)
package/lib/ArrayUtil.js CHANGED
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -76,7 +76,18 @@ export declare namespace DynamicExecutor {
76
76
  * @param parameters Parameters, result of options.parameters function.
77
77
  * @returns Wrapper function
78
78
  */
79
- wrapper?: (name: string, closure: Closure<Parameters, Ret>, paramters: Parameters) => Promise<any>;
79
+ wrapper?: (name: string, closure: Closure<Parameters, Ret>, parameters: Parameters) => Promise<any>;
80
+ /**
81
+ * Number of simultaneous requests.
82
+ *
83
+ * The number of requests to be executed simultaneously.
84
+ *
85
+ * If you configure a value greater than one, the dynamic executor will
86
+ * process the functions concurrently with the given capacity value.
87
+ *
88
+ * @default 1
89
+ */
90
+ simultaneous?: number;
80
91
  /**
81
92
  * Extension of dynamic functions.
82
93
  *
@@ -114,7 +125,7 @@ export declare namespace DynamicExecutor {
114
125
  */
115
126
  location: string;
116
127
  /**
117
- * Error when occured.
128
+ * Error when occurred.
118
129
  */
119
130
  error: Error | null;
120
131
  /**
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -32,8 +42,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
42
  });
33
43
  };
34
44
  var __generator = (this && this.__generator) || function (thisArg, body) {
35
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
45
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
46
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
47
  function verb(n) { return function (v) { return step([n, v]); }; }
38
48
  function step(op) {
39
49
  if (f) throw new TypeError("Generator is already executing.");
@@ -146,10 +156,11 @@ var DynamicExecutor;
146
156
  DynamicExecutor.validate = function (props) { return main(false)(props); };
147
157
  var main = function (assert) {
148
158
  return function (props) { return __awaiter(_this, void 0, void 0, function () {
149
- var report, executor, iterator;
150
- var _a;
151
- return __generator(this, function (_b) {
152
- switch (_b.label) {
159
+ var report, executor, processes;
160
+ var _this = this;
161
+ var _a, _b;
162
+ return __generator(this, function (_c) {
163
+ switch (_c.label) {
153
164
  case 0:
154
165
  report = {
155
166
  location: props.location,
@@ -157,86 +168,125 @@ var DynamicExecutor;
157
168
  executions: [],
158
169
  };
159
170
  executor = execute(props)(report)(assert);
160
- iterator = iterate((_a = props.extension) !== null && _a !== void 0 ? _a : "js")(executor);
161
- return [4 /*yield*/, iterator(props.location)];
171
+ return [4 /*yield*/, iterate({
172
+ extension: (_a = props.extension) !== null && _a !== void 0 ? _a : "js",
173
+ location: props.location,
174
+ executor: executor,
175
+ })];
162
176
  case 1:
163
- _b.sent();
177
+ processes = _c.sent();
178
+ return [4 /*yield*/, Promise.all(new Array((_b = props.simultaneous) !== null && _b !== void 0 ? _b : 1).fill(0).map(function () { return __awaiter(_this, void 0, void 0, function () {
179
+ var task;
180
+ return __generator(this, function (_a) {
181
+ switch (_a.label) {
182
+ case 0:
183
+ if (!(processes.length !== 0)) return [3 /*break*/, 2];
184
+ task = processes.shift();
185
+ return [4 /*yield*/, (task === null || task === void 0 ? void 0 : task())];
186
+ case 1:
187
+ _a.sent();
188
+ return [3 /*break*/, 0];
189
+ case 2: return [2 /*return*/];
190
+ }
191
+ });
192
+ }); }))];
193
+ case 2:
194
+ _c.sent();
164
195
  report.time = Date.now() - report.time;
165
196
  return [2 /*return*/, report];
166
197
  }
167
198
  });
168
199
  }); };
169
200
  };
170
- var iterate = function (extension) {
171
- return function (executor) {
172
- var visitor = function (path) { return __awaiter(_this, void 0, void 0, function () {
173
- var directory, directory_1, directory_1_1, file, location_1, stats, modulo, e_1_1;
174
- var e_1, _a;
175
- return __generator(this, function (_b) {
176
- switch (_b.label) {
177
- case 0: return [4 /*yield*/, fs_1.default.promises.readdir(path)];
178
- case 1:
179
- directory = _b.sent();
180
- _b.label = 2;
181
- case 2:
182
- _b.trys.push([2, 12, 13, 14]);
183
- directory_1 = __values(directory), directory_1_1 = directory_1.next();
184
- _b.label = 3;
185
- case 3:
186
- if (!!directory_1_1.done) return [3 /*break*/, 11];
187
- file = directory_1_1.value;
188
- location_1 = path_1.default.resolve("".concat(path, "/").concat(file));
189
- return [4 /*yield*/, fs_1.default.promises.lstat(location_1)];
190
- case 4:
191
- stats = _b.sent();
192
- if (!(stats.isDirectory() === true)) return [3 /*break*/, 6];
193
- return [4 /*yield*/, visitor(location_1)];
194
- case 5:
195
- _b.sent();
196
- return [3 /*break*/, 10];
197
- case 6:
198
- if (file.substr(-3) !== ".".concat(extension))
199
- return [3 /*break*/, 10];
200
- _b.label = 7;
201
- case 7: return [4 /*yield*/, Promise.resolve("".concat(location_1)).then(function (s) { return __importStar(require(s)); })];
202
- case 8:
203
- modulo = _b.sent();
204
- return [4 /*yield*/, executor(location_1, modulo)];
205
- case 9:
206
- _b.sent();
207
- _b.label = 10;
208
- case 10:
209
- directory_1_1 = directory_1.next();
210
- return [3 /*break*/, 3];
211
- case 11: return [3 /*break*/, 14];
212
- case 12:
213
- e_1_1 = _b.sent();
214
- e_1 = { error: e_1_1 };
215
- return [3 /*break*/, 14];
216
- case 13:
217
- try {
218
- if (directory_1_1 && !directory_1_1.done && (_a = directory_1.return)) _a.call(directory_1);
201
+ var iterate = function (props) { return __awaiter(_this, void 0, void 0, function () {
202
+ var container, visitor;
203
+ var _this = this;
204
+ return __generator(this, function (_a) {
205
+ switch (_a.label) {
206
+ case 0:
207
+ container = [];
208
+ visitor = function (path) { return __awaiter(_this, void 0, void 0, function () {
209
+ var directory, _loop_1, directory_1, directory_1_1, file, e_1_1;
210
+ var e_1, _a;
211
+ return __generator(this, function (_b) {
212
+ switch (_b.label) {
213
+ case 0: return [4 /*yield*/, fs_1.default.promises.readdir(path)];
214
+ case 1:
215
+ directory = _b.sent();
216
+ _loop_1 = function (file) {
217
+ var location_1, stats, modulo;
218
+ return __generator(this, function (_c) {
219
+ switch (_c.label) {
220
+ case 0:
221
+ location_1 = path_1.default.resolve("".concat(path, "/").concat(file));
222
+ return [4 /*yield*/, fs_1.default.promises.lstat(location_1)];
223
+ case 1:
224
+ stats = _c.sent();
225
+ if (!(stats.isDirectory() === true)) return [3 /*break*/, 3];
226
+ return [4 /*yield*/, visitor(location_1)];
227
+ case 2:
228
+ _c.sent();
229
+ return [2 /*return*/, "continue"];
230
+ case 3:
231
+ if (file.substr(-3) !== ".".concat(props.extension))
232
+ return [2 /*return*/, "continue"];
233
+ _c.label = 4;
234
+ case 4: return [4 /*yield*/, Promise.resolve("".concat(location_1)).then(function (s) { return __importStar(require(s)); })];
235
+ case 5:
236
+ modulo = _c.sent();
237
+ container.push(function () { return props.executor(location_1, modulo); });
238
+ return [2 /*return*/];
239
+ }
240
+ });
241
+ };
242
+ _b.label = 2;
243
+ case 2:
244
+ _b.trys.push([2, 7, 8, 9]);
245
+ directory_1 = __values(directory), directory_1_1 = directory_1.next();
246
+ _b.label = 3;
247
+ case 3:
248
+ if (!!directory_1_1.done) return [3 /*break*/, 6];
249
+ file = directory_1_1.value;
250
+ return [5 /*yield**/, _loop_1(file)];
251
+ case 4:
252
+ _b.sent();
253
+ _b.label = 5;
254
+ case 5:
255
+ directory_1_1 = directory_1.next();
256
+ return [3 /*break*/, 3];
257
+ case 6: return [3 /*break*/, 9];
258
+ case 7:
259
+ e_1_1 = _b.sent();
260
+ e_1 = { error: e_1_1 };
261
+ return [3 /*break*/, 9];
262
+ case 8:
263
+ try {
264
+ if (directory_1_1 && !directory_1_1.done && (_a = directory_1.return)) _a.call(directory_1);
265
+ }
266
+ finally { if (e_1) throw e_1.error; }
267
+ return [7 /*endfinally*/];
268
+ case 9: return [2 /*return*/];
219
269
  }
220
- finally { if (e_1) throw e_1.error; }
221
- return [7 /*endfinally*/];
222
- case 14: return [2 /*return*/];
223
- }
224
- });
225
- }); };
226
- return visitor;
227
- };
228
- };
270
+ });
271
+ }); };
272
+ return [4 /*yield*/, visitor(props.location)];
273
+ case 1:
274
+ _a.sent();
275
+ return [2 /*return*/, container];
276
+ }
277
+ });
278
+ }); };
229
279
  var execute = function (props) {
230
280
  return function (report) {
231
281
  return function (assert) {
232
282
  return function (location, modulo) { return __awaiter(_this, void 0, void 0, function () {
233
- var _loop_1, _a, _b, _c, key, closure, e_2_1;
283
+ var _loop_2, _a, _b, _c, key, closure, e_2_1;
234
284
  var e_2, _d;
235
285
  var _this = this;
236
286
  return __generator(this, function (_e) {
237
287
  switch (_e.label) {
238
288
  case 0:
239
- _loop_1 = function (key, closure) {
289
+ _loop_2 = function (key, closure) {
240
290
  var func, result, exp_1;
241
291
  return __generator(this, function (_f) {
242
292
  switch (_f.label) {
@@ -301,7 +351,7 @@ var DynamicExecutor;
301
351
  case 2:
302
352
  if (!!_b.done) return [3 /*break*/, 5];
303
353
  _c = __read(_b.value, 2), key = _c[0], closure = _c[1];
304
- return [5 /*yield**/, _loop_1(key, closure)];
354
+ return [5 /*yield**/, _loop_2(key, closure)];
305
355
  case 3:
306
356
  _e.sent();
307
357
  _e.label = 4;
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicExecutor.js","sourceRoot":"","sources":["../src/DynamicExecutor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAoB;AACpB,8CAA4B;AAE5B;;;;;;;;;;;;;;;;;GAiBG;AACH,IAAiB,eAAe,CAoP/B;AApPD,WAAiB,eAAe;;IAkI9B;;;;;;;;;OASG;IACU,sBAAM,GAAG,UACpB,KAAwB,IACH,OAAA,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAjB,CAAiB,CAAC;IAEzC;;;;;;;;;OASG;IACU,wBAAQ,GAAG,UACtB,KAAwB,IACH,OAAA,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,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CAAxC,KAAA,mBAAc,EAAb,GAAG,QAAA,EAAE,OAAO,QAAA;8DAAZ,GAAG,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;qBAkCzB;YAnCD,CAmCC;QApCD,CAoCC;IArCD,CAqCC,CAAC;AAKN,CAAC,EA5QgB,eAAe,+BAAf,eAAe,QA4Q/B"}
@@ -37,10 +37,10 @@ export declare namespace RandomGenerator {
37
37
  /**
38
38
  * Generate random content.
39
39
  *
40
- * @param paragraphes Number of paragraphes
40
+ * @param paragraphs Number of paragraphs
41
41
  * @returns Currying function
42
42
  */
43
- const content: (paragraphes?: number) => (sentenceMin?: number, sentenceMax?: number) => (wordMin?: number, wordMax?: number) => string;
43
+ const content: (paragraphs?: number) => (sentenceMin?: number, sentenceMax?: number) => (wordMin?: number, wordMax?: number) => string;
44
44
  /**
45
45
  * Generate random substring.
46
46
  *
@@ -74,11 +74,11 @@ var RandomGenerator;
74
74
  /**
75
75
  * Generate random content.
76
76
  *
77
- * @param paragraphes Number of paragraphes
77
+ * @param paragraphs Number of paragraphs
78
78
  * @returns Currying function
79
79
  */
80
- RandomGenerator.content = function (paragraphes) {
81
- if (paragraphes === void 0) { paragraphes = randint(3, 8); }
80
+ RandomGenerator.content = function (paragraphs) {
81
+ if (paragraphs === void 0) { paragraphs = randint(3, 8); }
82
82
  /**
83
83
  * @param sentenceMin Minimum number of sentences in a paragraph
84
84
  * @param sentenceMax Maximum number of sentences in a paragraph
@@ -95,7 +95,7 @@ var RandomGenerator;
95
95
  return function (wordMin, wordMax) {
96
96
  if (wordMin === void 0) { wordMin = 1; }
97
97
  if (wordMax === void 0) { wordMax = 7; }
98
- return new Array(paragraphes)
98
+ return new Array(paragraphs)
99
99
  .fill("")
100
100
  .map(function () {
101
101
  return RandomGenerator.paragraph(randint(sentenceMin, sentenceMax))(wordMin, wordMax);
@@ -1 +1 @@
1
- {"version":3,"file":"RandomGenerator.js","sourceRoot":"","sources":["../src/RandomGenerator.ts"],"names":[],"mappings":";;;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AO,CAAC,IAAI,GAAG,KAAK;gBAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;YACvE,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,KAAK,CAAC,KAAK,CAAC,EAAZ,CAAY,CAAC,CAAC;QAC1D,CAAC;IALD,CAKC,CAAC;IAEJ;;;;;OAKG;IACU,oBAAI,GAAG,UAAI,KAAU,IAAQ,OAAA,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAnC,CAAmC,CAAC;AAChF,CAAC,EAzJgB,eAAe,+BAAf,eAAe,QAyJ/B;AAED,IAAM,OAAO,GAAG,UAAC,GAAW,EAAE,GAAW;IACvC,OAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG;AAAjD,CAAiD,CAAC"}
@@ -74,9 +74,9 @@ export declare namespace TestValidator {
74
74
  *
75
75
  * Test a pagination API supporting sorting options.
76
76
  *
77
- * You can validate detailed sorting options both asceding and descending orders
77
+ * You can validate detailed sorting options both ascending and descending orders
78
78
  * with multiple fields. However, as it forms a complicate currying function,
79
- * I recomend you to see below example code before using.
79
+ * I recommend you to see below example code before using.
80
80
  *
81
81
  * @param title Title of error message when sorting is invalid
82
82
  * @example https://github.com/samchon/nestia-template/blob/master/src/test/features/api/bbs/test_api_bbs_article_index_sort.ts
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -358,9 +358,9 @@ var TestValidator;
358
358
  *
359
359
  * Test a pagination API supporting sorting options.
360
360
  *
361
- * You can validate detailed sorting options both asceding and descending orders
361
+ * You can validate detailed sorting options both ascending and descending orders
362
362
  * with multiple fields. However, as it forms a complicate currying function,
363
- * I recomend you to see below example code before using.
363
+ * I recommend you to see below example code before using.
364
364
  *
365
365
  * @param title Title of error message when sorting is invalid
366
366
  * @example https://github.com/samchon/nestia-template/blob/master/src/test/features/api/bbs/test_api_bbs_article_index_sort.ts
package/lib/index.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
37
  };
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAgC;AAEhC,kBAAe,GAAG,CAAC;AACnB,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAgC;AAEhC,kBAAe,GAAG,CAAC;AACnB,2CAAyB"}
package/package.json CHANGED
@@ -1,53 +1,53 @@
1
- {
2
- "name": "@nestia/e2e",
3
- "version": "0.7.0",
4
- "description": "E2E test utilify functions",
5
- "main": "lib/index.js",
6
- "typings": "lib/index.d.ts",
7
- "scripts": {
8
- "build": "npm run build:main && npm run build:test",
9
- "build:main": "rimraf lib && tsc",
10
- "build:test": "rimraf bin && tsc -p test/tsconfig.json",
11
- "dev": "npm run build:test -- --watch",
12
- "eslint": "eslint src && eslint test",
13
- "prepare": "ts-patch install && typia patch",
14
- "test": "node bin/test"
15
- },
16
- "repository": {
17
- "type": "git",
18
- "url": "https://github.com/samchon/nestia"
19
- },
20
- "keywords": [
21
- "e2e",
22
- "nestia",
23
- "nestjs",
24
- "test",
25
- "tdd",
26
- "utility"
27
- ],
28
- "author": "Jeongho Nam",
29
- "license": "MIT",
30
- "bugs": {
31
- "url": "https://github.com/samchon/nestia/issues"
32
- },
33
- "homepage": "https://nestia.io",
34
- "devDependencies": {
35
- "@trivago/prettier-plugin-sort-imports": "^4.0.0",
36
- "@types/node": "^18.11.18",
37
- "@typescript-eslint/eslint-plugin": "^5.57.0",
38
- "@typescript-eslint/parser": "^5.57.0",
39
- "rimraf": "^4.1.2",
40
- "ts-node": "^10.9.1",
41
- "ts-patch": "^3.2.1",
42
- "typescript": "^5.5.3",
43
- "typescript-transform-paths": "^3.4.7",
44
- "typia": "^6.4.3"
45
- },
46
- "files": [
47
- "lib",
48
- "src",
49
- "README.md",
50
- "LICENSE",
51
- "package.json"
52
- ]
53
- }
1
+ {
2
+ "name": "@nestia/e2e",
3
+ "version": "0.8.0",
4
+ "description": "E2E test utilify functions",
5
+ "main": "lib/index.js",
6
+ "typings": "lib/index.d.ts",
7
+ "scripts": {
8
+ "build": "npm run build:main && npm run build:test",
9
+ "build:main": "rimraf lib && tsc",
10
+ "build:test": "rimraf bin && tsc -p test/tsconfig.json",
11
+ "dev": "npm run build:test -- --watch",
12
+ "eslint": "eslint src && eslint test",
13
+ "prepare": "ts-patch install && typia patch",
14
+ "test": "node bin/test"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/samchon/nestia"
19
+ },
20
+ "keywords": [
21
+ "e2e",
22
+ "nestia",
23
+ "nestjs",
24
+ "test",
25
+ "tdd",
26
+ "utility"
27
+ ],
28
+ "author": "Jeongho Nam",
29
+ "license": "MIT",
30
+ "bugs": {
31
+ "url": "https://github.com/samchon/nestia/issues"
32
+ },
33
+ "homepage": "https://nestia.io",
34
+ "devDependencies": {
35
+ "@trivago/prettier-plugin-sort-imports": "^4.0.0",
36
+ "@types/node": "^18.11.18",
37
+ "@typescript-eslint/eslint-plugin": "^5.57.0",
38
+ "@typescript-eslint/parser": "^5.57.0",
39
+ "rimraf": "^6.0.1",
40
+ "ts-node": "^10.9.1",
41
+ "ts-patch": "^3.3.0",
42
+ "typescript": "~5.7.2",
43
+ "typescript-transform-paths": "^3.4.7",
44
+ "typia": "^7.6.0"
45
+ },
46
+ "files": [
47
+ "lib",
48
+ "src",
49
+ "README.md",
50
+ "LICENSE",
51
+ "package.json"
52
+ ]
53
+ }
@@ -88,9 +88,21 @@ export namespace DynamicExecutor {
88
88
  wrapper?: (
89
89
  name: string,
90
90
  closure: Closure<Parameters, Ret>,
91
- paramters: Parameters,
91
+ parameters: Parameters,
92
92
  ) => Promise<any>;
93
93
 
94
+ /**
95
+ * Number of simultaneous requests.
96
+ *
97
+ * The number of requests to be executed simultaneously.
98
+ *
99
+ * If you configure a value greater than one, the dynamic executor will
100
+ * process the functions concurrently with the given capacity value.
101
+ *
102
+ * @default 1
103
+ */
104
+ simultaneous?: number;
105
+
94
106
  /**
95
107
  * Extension of dynamic functions.
96
108
  *
@@ -134,7 +146,7 @@ export namespace DynamicExecutor {
134
146
  location: string;
135
147
 
136
148
  /**
137
- * Error when occured.
149
+ * Error when occurred.
138
150
  */
139
151
  error: Error | null;
140
152
 
@@ -189,35 +201,47 @@ export namespace DynamicExecutor {
189
201
  };
190
202
 
191
203
  const executor = execute(props)(report)(assert);
192
- const iterator = iterate(props.extension ?? "js")(executor);
193
- await iterator(props.location);
194
-
204
+ const processes: Array<() => Promise<void>> = await iterate({
205
+ extension: props.extension ?? "js",
206
+ location: props.location,
207
+ executor,
208
+ });
209
+ await Promise.all(
210
+ new Array(props.simultaneous ?? 1).fill(0).map(async () => {
211
+ while (processes.length !== 0) {
212
+ const task = processes.shift();
213
+ await task?.();
214
+ }
215
+ }),
216
+ );
195
217
  report.time = Date.now() - report.time;
196
218
  return report;
197
219
  };
198
220
 
199
- const iterate =
200
- (extension: string) =>
201
- <Arguments extends any[]>(
202
- executor: (path: string, modulo: Module<Arguments>) => Promise<void>,
203
- ) => {
204
- const visitor = async (path: string): Promise<void> => {
205
- const directory: string[] = await fs.promises.readdir(path);
206
- for (const file of directory) {
207
- const location: string = NodePath.resolve(`${path}/${file}`);
208
- const stats: fs.Stats = await fs.promises.lstat(location);
221
+ const iterate = async <Arguments extends any[]>(props: {
222
+ location: string;
223
+ extension: string;
224
+ executor: (path: string, modulo: Module<Arguments>) => Promise<void>;
225
+ }): Promise<Array<() => Promise<void>>> => {
226
+ const container: Array<() => Promise<void>> = [];
227
+ const visitor = async (path: string): Promise<void> => {
228
+ const directory: string[] = await fs.promises.readdir(path);
229
+ for (const file of directory) {
230
+ const location: string = NodePath.resolve(`${path}/${file}`);
231
+ const stats: fs.Stats = await fs.promises.lstat(location);
209
232
 
210
- if (stats.isDirectory() === true) {
211
- await visitor(location);
212
- continue;
213
- } else if (file.substr(-3) !== `.${extension}`) continue;
233
+ if (stats.isDirectory() === true) {
234
+ await visitor(location);
235
+ continue;
236
+ } else if (file.substr(-3) !== `.${props.extension}`) continue;
214
237
 
215
- const modulo: Module<Arguments> = await import(location);
216
- await executor(location, modulo);
217
- }
218
- };
219
- return visitor;
238
+ const modulo: Module<Arguments> = await import(location);
239
+ container.push(() => props.executor(location, modulo));
240
+ }
220
241
  };
242
+ await visitor(props.location);
243
+ return container;
244
+ };
221
245
 
222
246
  const execute =
223
247
  <Arguments extends any[]>(props: IProps<Arguments>) =>
@@ -67,11 +67,11 @@ export namespace RandomGenerator {
67
67
  /**
68
68
  * Generate random content.
69
69
  *
70
- * @param paragraphes Number of paragraphes
70
+ * @param paragraphs Number of paragraphs
71
71
  * @returns Currying function
72
72
  */
73
73
  export const content =
74
- (paragraphes: number = randint(3, 8)) =>
74
+ (paragraphs: number = randint(3, 8)) =>
75
75
  /**
76
76
  * @param sentenceMin Minimum number of sentences in a paragraph
77
77
  * @param sentenceMax Maximum number of sentences in a paragraph
@@ -84,7 +84,7 @@ export namespace RandomGenerator {
84
84
  * @returns Content generator
85
85
  */
86
86
  (wordMin: number = 1, wordMax: number = 7): string =>
87
- new Array(paragraphes)
87
+ new Array(paragraphs)
88
88
  .fill("")
89
89
  .map(() =>
90
90
  paragraph(randint(sentenceMin, sentenceMax))(wordMin, wordMax),
@@ -261,9 +261,9 @@ export namespace TestValidator {
261
261
  *
262
262
  * Test a pagination API supporting sorting options.
263
263
  *
264
- * You can validate detailed sorting options both asceding and descending orders
264
+ * You can validate detailed sorting options both ascending and descending orders
265
265
  * with multiple fields. However, as it forms a complicate currying function,
266
- * I recomend you to see below example code before using.
266
+ * I recommend you to see below example code before using.
267
267
  *
268
268
  * @param title Title of error message when sorting is invalid
269
269
  * @example https://github.com/samchon/nestia-template/blob/master/src/test/features/api/bbs/test_api_bbs_article_index_sort.ts