@nestia/e2e 11.0.0-dev.20260305 → 11.0.0-dev.20260312

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.
@@ -0,0 +1,495 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TestValidator = void 0;
13
+ const RandomGenerator_1 = require("./RandomGenerator");
14
+ const json_equal_to_1 = require("./internal/json_equal_to");
15
+ /**
16
+ * A comprehensive collection of E2E validation utilities for testing
17
+ * applications.
18
+ *
19
+ * TestValidator provides type-safe validation functions for common testing
20
+ * scenarios including condition checking, equality validation, error testing,
21
+ * HTTP error validation, pagination testing, search functionality validation,
22
+ * and sorting validation.
23
+ *
24
+ * Most functions use direct parameter passing for simplicity, while some
25
+ * maintain currying patterns for advanced composition. All provide detailed
26
+ * error messages for debugging failed assertions.
27
+ *
28
+ * @author Jeongho Nam - https://github.com/samchon
29
+ * @example
30
+ * ```typescript
31
+ * // Basic condition testing
32
+ * TestValidator.predicate("user should be authenticated", user.isAuthenticated);
33
+ *
34
+ * // Equality validation
35
+ * TestValidator.equals("API response should match expected", x, y);
36
+ *
37
+ * // Error validation
38
+ * TestValidator.error("should throw on invalid input", () => assertInput(""));
39
+ * ```;
40
+ */
41
+ var TestValidator;
42
+ (function (TestValidator) {
43
+ /**
44
+ * Validates that a given condition evaluates to true.
45
+ *
46
+ * Supports synchronous boolean values, synchronous functions returning
47
+ * boolean, and asynchronous functions returning Promise<boolean>. The return
48
+ * type is automatically inferred based on the input type.
49
+ *
50
+ * @example
51
+ * ```typescript
52
+ * // Synchronous boolean
53
+ * TestValidator.predicate("user should exist", user !== null);
54
+ *
55
+ * // Synchronous function
56
+ * TestValidator.predicate("array should be empty", () => arr.length === 0);
57
+ *
58
+ * // Asynchronous function
59
+ * await TestValidator.predicate("database should be connected",
60
+ * async () => await db.ping()
61
+ * );
62
+ * ```;
63
+ *
64
+ * @param title - Descriptive title used in error messages when validation
65
+ * fails
66
+ * @param condition - The condition to validate (boolean, function, or async
67
+ * function)
68
+ * @returns Void or Promise<void> based on the input type
69
+ * @throws Error with descriptive message when condition is not satisfied
70
+ */
71
+ function predicate(title, condition) {
72
+ const message = () => `Bug on ${title}: expected condition is not satisfied.`;
73
+ // SCALAR
74
+ if (typeof condition === "boolean") {
75
+ if (condition !== true)
76
+ throw new Error(message());
77
+ return undefined;
78
+ }
79
+ // CLOSURE
80
+ const output = condition();
81
+ if (typeof output === "boolean") {
82
+ if (output !== true)
83
+ throw new Error(message());
84
+ return undefined;
85
+ }
86
+ // ASYNCHRONOUS
87
+ return new Promise((resolve, reject) => {
88
+ output
89
+ .then((flag) => {
90
+ if (flag === true)
91
+ resolve();
92
+ else
93
+ reject(message());
94
+ })
95
+ .catch(reject);
96
+ });
97
+ }
98
+ TestValidator.predicate = predicate;
99
+ /**
100
+ * Validates deep equality between two values using JSON comparison.
101
+ *
102
+ * Performs recursive comparison of objects and arrays. Supports an optional
103
+ * exception filter to ignore specific keys during comparison. Useful for
104
+ * validating API responses, data transformations, and object state changes.
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * // Basic equality
109
+ * TestValidator.equals("response should match expected", expectedUser, actualUser);
110
+ *
111
+ * // Ignore timestamps in comparison
112
+ * TestValidator.equals("user data should match", expectedUser, actualUser,
113
+ * (key) => key === "updatedAt"
114
+ * );
115
+ *
116
+ * // Validate API response structure
117
+ * TestValidator.equals("API response structure",
118
+ * { id: 1, name: "John" },
119
+ * { id: 1, name: "John" }
120
+ * );
121
+ *
122
+ * // Type-safe nullable comparisons
123
+ * const nullableData: { name: string } | null = getData();
124
+ * TestValidator.equals("nullable check", nullableData, null);
125
+ * ```;
126
+ *
127
+ * @param title - Descriptive title used in error messages when values differ
128
+ * @param X - The first value to compare
129
+ * @param y - The second value to compare (can be null or undefined)
130
+ * @param exception - Optional filter function to exclude specific keys from
131
+ * comparison
132
+ * @throws Error with detailed diff information when values are not equal
133
+ */
134
+ function equals(title, X, y, exception) {
135
+ const diff = (0, json_equal_to_1.json_equal_to)(exception !== null && exception !== void 0 ? exception : (() => false))(X)(y);
136
+ if (diff.length)
137
+ throw new Error([
138
+ `Bug on ${title}: found different values - [${diff.join(", ")}]:`,
139
+ "\n",
140
+ JSON.stringify({ x: X, y }, null, 2),
141
+ ].join("\n"));
142
+ }
143
+ TestValidator.equals = equals;
144
+ /**
145
+ * Validates deep inequality between two values using JSON comparison.
146
+ *
147
+ * Performs recursive comparison of objects and arrays to ensure they are NOT
148
+ * equal. Supports an optional exception filter to ignore specific keys during
149
+ * comparison. Useful for validating that data has changed, objects are
150
+ * different, or mutations have occurred.
151
+ *
152
+ * @example
153
+ * ```typescript
154
+ * // Basic inequality
155
+ * TestValidator.notEquals("user should be different after update", originalUser, updatedUser);
156
+ *
157
+ * // Ignore timestamps in comparison
158
+ * TestValidator.notEquals("user data should differ", originalUser, modifiedUser,
159
+ * (key) => key === "updatedAt"
160
+ * );
161
+ *
162
+ * // Validate state changes
163
+ * TestValidator.notEquals("state should have changed", initialState, currentState);
164
+ *
165
+ * // Type-safe nullable comparisons
166
+ * const mutableData: { count: number } | null = getMutableData();
167
+ * TestValidator.notEquals("should have changed", mutableData, null);
168
+ * ```;
169
+ *
170
+ * @param title - Descriptive title used in error messages when values are
171
+ * equal
172
+ * @param x - The first value to compare
173
+ * @param y - The second value to compare (can be null or undefined)
174
+ * @param exception - Optional filter function to exclude specific keys from
175
+ * comparison
176
+ * @throws Error when values are equal (indicating validation failure)
177
+ */
178
+ function notEquals(title, x, y, exception) {
179
+ const diff = (0, json_equal_to_1.json_equal_to)(exception !== null && exception !== void 0 ? exception : (() => false))(x)(y);
180
+ if (diff.length === 0)
181
+ throw new Error([
182
+ `Bug on ${title}: values should be different but are equal:`,
183
+ "\n",
184
+ JSON.stringify({ x, y }, null, 2),
185
+ ].join("\n"));
186
+ }
187
+ TestValidator.notEquals = notEquals;
188
+ /**
189
+ * Validates that a function throws an error or rejects when executed.
190
+ *
191
+ * Expects the provided function to fail. If the function executes
192
+ * successfully without throwing an error or rejecting, this validator will
193
+ * throw an exception. Supports both synchronous and asynchronous functions.
194
+ *
195
+ * @example
196
+ * ```typescript
197
+ * // Synchronous error validation
198
+ * TestValidator.error("should reject invalid email",
199
+ * () => validateEmail("invalid-email")
200
+ * );
201
+ *
202
+ * // Asynchronous error validation
203
+ * await TestValidator.error("should reject unauthorized access",
204
+ * async () => await api.functional.getSecretData()
205
+ * );
206
+ *
207
+ * // Validate input validation
208
+ * TestValidator.error("should throw on empty string",
209
+ * () => processRequiredInput("")
210
+ * );
211
+ * ```;
212
+ *
213
+ * @param title - Descriptive title used in error messages when no error
214
+ * occurs
215
+ * @param task - The function that should throw an error or reject
216
+ * @returns Void or Promise<void> based on the input type
217
+ * @throws Error when the task function does not throw an error or reject
218
+ */
219
+ function error(title, task) {
220
+ const message = () => `Bug on ${title}: exception must be thrown.`;
221
+ try {
222
+ const output = task();
223
+ if (is_promise(output))
224
+ return new Promise((resolve, reject) => output.catch(() => resolve()).then(() => reject(message())));
225
+ else
226
+ throw new Error(message());
227
+ }
228
+ catch (_a) {
229
+ return undefined;
230
+ }
231
+ }
232
+ TestValidator.error = error;
233
+ /**
234
+ * Validates that a function throws an HTTP error with specific status codes.
235
+ *
236
+ * Specialized error validator for HTTP operations. Validates that the
237
+ * function throws an HttpError with one of the specified status codes. Useful
238
+ * for testing API endpoints, authentication, and authorization logic.
239
+ *
240
+ * @example
241
+ * ```typescript
242
+ * // Validate 401 Unauthorized
243
+ * await TestValidator.httpError("should return 401 for invalid token", 401,
244
+ * async () => await api.functional.getProtectedResource("invalid-token")
245
+ * );
246
+ *
247
+ * // Validate multiple possible error codes
248
+ * await TestValidator.httpError("should return client error", [400, 404, 422],
249
+ * async () => await api.functional.updateNonexistentResource(data)
250
+ * );
251
+ *
252
+ * // Validate server errors
253
+ * TestValidator.httpError("should handle server errors", [500, 502, 503],
254
+ * () => callFaultyEndpoint()
255
+ * );
256
+ * ```;
257
+ *
258
+ * @param title - Descriptive title used in error messages
259
+ * @param status - Expected status code(s), can be a single number or array
260
+ * @param task - The function that should throw an HttpError
261
+ * @returns Void or Promise<void> based on the input type
262
+ * @throws Error when function doesn't throw HttpError or status code doesn't
263
+ * match
264
+ */
265
+ function httpError(title, status, task) {
266
+ if (typeof status === "number")
267
+ status = [status];
268
+ const message = (actual) => typeof actual === "number"
269
+ ? `Bug on ${title}: status code must be ${status.join(" or ")}, but ${actual}.`
270
+ : `Bug on ${title}: status code must be ${status.join(" or ")}, but succeeded.`;
271
+ const predicate = (exp) => typeof exp === "object" &&
272
+ exp.constructor.name === "HttpError" &&
273
+ status.some((val) => val === exp.status)
274
+ ? null
275
+ : new Error(message(typeof exp === "object" && exp.constructor.name === "HttpError"
276
+ ? exp.status
277
+ : undefined));
278
+ try {
279
+ const output = task();
280
+ if (is_promise(output))
281
+ return new Promise((resolve, reject) => output
282
+ .catch((exp) => {
283
+ const res = predicate(exp);
284
+ if (res)
285
+ reject(res);
286
+ else
287
+ resolve();
288
+ })
289
+ .then(() => reject(new Error(message()))));
290
+ else
291
+ throw new Error(message());
292
+ }
293
+ catch (exp) {
294
+ const res = predicate(exp);
295
+ if (res)
296
+ throw res;
297
+ return undefined;
298
+ }
299
+ }
300
+ TestValidator.httpError = httpError;
301
+ /**
302
+ * Validates pagination index API results against expected entity order.
303
+ *
304
+ * Compares the order of entities returned by a pagination API with manually
305
+ * sorted expected results. Validates that entity IDs appear in the correct
306
+ * sequence. Commonly used for testing database queries, search results, and
307
+ * any paginated data APIs.
308
+ *
309
+ * @example
310
+ * ```typescript
311
+ * // Test article pagination
312
+ * const expectedArticles = await db.articles.findAll({ order: 'created_at DESC' });
313
+ * const actualArticles = await api.functional.getArticles({ page: 1, limit: 10 });
314
+ *
315
+ * TestValidator.index("article pagination order", expectedArticles, actualArticles,
316
+ * true // enable trace logging
317
+ * );
318
+ *
319
+ * // Test user search results
320
+ * const manuallyFilteredUsers = allUsers.filter(u => u.name.includes("John"));
321
+ * const apiSearchResults = await api.functional.searchUsers({ query: "John" });
322
+ *
323
+ * TestValidator.index("user search results", manuallyFilteredUsers, apiSearchResults);
324
+ * ```;
325
+ *
326
+ * @param title - Descriptive title used in error messages when order differs
327
+ * @param expected - The expected entities in correct order
328
+ * @param gotten - The actual entities returned by the API
329
+ * @param trace - Optional flag to enable debug logging (default: false)
330
+ * @throws Error when entity order differs between expected and actual results
331
+ */
332
+ TestValidator.index = (title, expected, gotten, trace = false) => {
333
+ const length = Math.min(expected.length, gotten.length);
334
+ expected = expected.slice(0, length);
335
+ gotten = gotten.slice(0, length);
336
+ const xIds = get_ids(expected).slice(0, length);
337
+ const yIds = get_ids(gotten)
338
+ .filter((id) => id >= xIds[0])
339
+ .slice(0, length);
340
+ const equals = xIds.every((x, i) => x === yIds[i]);
341
+ if (equals === true)
342
+ return;
343
+ else if (trace === true)
344
+ console.log({
345
+ expected: xIds,
346
+ gotten: yIds,
347
+ });
348
+ throw new Error(`Bug on ${title}: result of the index is different with manual aggregation.`);
349
+ };
350
+ /**
351
+ * Validates search functionality by testing API results against manual
352
+ * filtering.
353
+ *
354
+ * Comprehensive search validation that samples entities from a complete
355
+ * dataset, extracts search values, applies manual filtering, calls the search
356
+ * API, and compares results. Validates that search APIs return the correct
357
+ * subset of data matching the search criteria.
358
+ *
359
+ * @example
360
+ * ```typescript
361
+ * // Test article search functionality with exact matching
362
+ * const allArticles = await db.articles.findAll();
363
+ * const searchValidator = TestValidator.search(
364
+ * "article search API",
365
+ * (req) => api.searchArticles(req),
366
+ * allArticles,
367
+ * 5 // test with 5 random samples
368
+ * );
369
+ *
370
+ * // Test exact match search
371
+ * await searchValidator({
372
+ * fields: ["title"],
373
+ * values: (article) => [article.title], // full title for exact match
374
+ * filter: (article, [title]) => article.title === title, // exact match
375
+ * request: ([title]) => ({ search: { title } })
376
+ * });
377
+ *
378
+ * // Test partial match search with includes
379
+ * await searchValidator({
380
+ * fields: ["content"],
381
+ * values: (article) => [article.content.substring(0, 20)], // partial content
382
+ * filter: (article, [keyword]) => article.content.includes(keyword),
383
+ * request: ([keyword]) => ({ q: keyword })
384
+ * });
385
+ *
386
+ * // Test multi-field search with exact matching
387
+ * await searchValidator({
388
+ * fields: ["writer", "title"],
389
+ * values: (article) => [article.writer, article.title],
390
+ * filter: (article, [writer, title]) =>
391
+ * article.writer === writer && article.title === title,
392
+ * request: ([writer, title]) => ({ search: { writer, title } })
393
+ * });
394
+ * ```;
395
+ *
396
+ * @param title - Descriptive title used in error messages when search fails
397
+ * @param getter - API function that performs the search
398
+ * @param total - Complete dataset to sample from for testing
399
+ * @param sampleCount - Number of random samples to test (default: 1)
400
+ * @returns A function that accepts search configuration properties
401
+ * @throws Error when API search results don't match manual filtering results
402
+ */
403
+ TestValidator.search = (title, getter, total, sampleCount = 1) => (props) => __awaiter(this, void 0, void 0, function* () {
404
+ const samples = RandomGenerator_1.RandomGenerator.sample(total, sampleCount);
405
+ for (const s of samples) {
406
+ const values = props.values(s);
407
+ const filtered = total.filter((entity) => props.filter(entity, values));
408
+ const gotten = yield getter(props.request(values));
409
+ TestValidator.index(`${title} (${props.fields.join(", ")})`, filtered, gotten);
410
+ }
411
+ });
412
+ /**
413
+ * Validates sorting functionality of pagination APIs.
414
+ *
415
+ * Tests sorting operations by calling the API with sort parameters and
416
+ * validating that results are correctly ordered. Supports multiple fields,
417
+ * ascending/descending order, and optional filtering. Provides detailed error
418
+ * reporting for sorting failures.
419
+ *
420
+ * @example
421
+ * ```typescript
422
+ * // Test single field sorting with GaffComparator
423
+ * const sortValidator = TestValidator.sort(
424
+ * "article sorting",
425
+ * (sortable) => api.getArticles({ sort: sortable })
426
+ * )("created_at")(
427
+ * GaffComparator.dates((a) => a.created_at)
428
+ * );
429
+ *
430
+ * await sortValidator("+"); // ascending
431
+ * await sortValidator("-"); // descending
432
+ *
433
+ * // Test multi-field sorting with GaffComparator
434
+ * const userSortValidator = TestValidator.sort(
435
+ * "user sorting",
436
+ * (sortable) => api.getUsers({ sort: sortable })
437
+ * )("lastName", "firstName")(
438
+ * GaffComparator.strings((user) => [user.lastName, user.firstName]),
439
+ * (user) => user.isActive // only test active users
440
+ * );
441
+ *
442
+ * await userSortValidator("+", true); // ascending with trace logging
443
+ *
444
+ * // Custom comparator for complex logic
445
+ * const customSortValidator = TestValidator.sort(
446
+ * "custom sorting",
447
+ * (sortable) => api.getProducts({ sort: sortable })
448
+ * )("price", "rating")(
449
+ * (a, b) => {
450
+ * const priceDiff = a.price - b.price;
451
+ * return priceDiff !== 0 ? priceDiff : b.rating - a.rating; // price asc, rating desc
452
+ * }
453
+ * );
454
+ * ```;
455
+ *
456
+ * @param title - Descriptive title used in error messages when sorting fails
457
+ * @param getter - API function that fetches sorted data
458
+ * @returns A currying function chain: field names, comparator, then direction
459
+ * @throws Error when API results are not properly sorted according to
460
+ * specification
461
+ */
462
+ TestValidator.sort = (title, getter) => (...fields) => (comp, filter) => (direction_1, ...args_1) => __awaiter(this, [direction_1, ...args_1], void 0, function* (direction, trace = false) {
463
+ let data = yield getter(fields.map((field) => `${direction}${field}`));
464
+ if (filter)
465
+ data = data.filter(filter);
466
+ const reversed = direction === "+" ? comp : (x, y) => comp(y, x);
467
+ if (is_sorted(data, reversed) === false) {
468
+ if (fields.length === 1 &&
469
+ data.length &&
470
+ data[0][fields[0]] !== undefined &&
471
+ trace)
472
+ console.log(data.map((elem) => elem[fields[0]]));
473
+ throw new Error(`Bug on ${title}: wrong sorting on ${direction}(${fields.join(", ")}).`);
474
+ }
475
+ });
476
+ })(TestValidator || (exports.TestValidator = TestValidator = {}));
477
+ /** @internal */
478
+ function get_ids(entities) {
479
+ return entities.map((entity) => entity.id).sort((x, y) => (x < y ? -1 : 1));
480
+ }
481
+ /** @internal */
482
+ function is_promise(input) {
483
+ return (typeof input === "object" &&
484
+ input !== null &&
485
+ typeof input.then === "function" &&
486
+ typeof input.catch === "function");
487
+ }
488
+ /** @internal */
489
+ function is_sorted(data, comp) {
490
+ for (let i = 1; i < data.length; ++i)
491
+ if (comp(data[i - 1], data[i]) > 0)
492
+ return false;
493
+ return true;
494
+ }
495
+ //# sourceMappingURL=TestValidator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestValidator.js","sourceRoot":"","sources":["../src/TestValidator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAoD;AACpD,4DAAyD;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,IAAiB,aAAa,CAmkB7B;AAnkBD,WAAiB,aAAa;IAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,SAAgB,SAAS,CAGvB,KAAa,EACb,SAAY;QAEZ,MAAM,OAAO,GAAG,GAAG,EAAE,CACnB,UAAU,KAAK,wCAAwC,CAAC;QAE1D,SAAS;QACT,IAAI,OAAO,SAAS,KAAK,SAAS,EAAE,CAAC;YACnC,IAAI,SAAS,KAAK,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACnD,OAAO,SAAgB,CAAC;QAC1B,CAAC;QAED,UAAU;QACV,MAAM,MAAM,GAA+B,SAAS,EAAE,CAAC;QACvD,IAAI,OAAO,MAAM,KAAK,SAAS,EAAE,CAAC;YAChC,IAAI,MAAM,KAAK,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAChD,OAAO,SAAgB,CAAC;QAC1B,CAAC;QAED,eAAe;QACf,OAAO,IAAI,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AAgB;AAChB,SAAS,SAAS,CAAI,IAAS,EAAE,IAA4B;IAC3D,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;QAC1C,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAE,EAAE,IAAI,CAAC,CAAC,CAAE,CAAC,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;IACrD,OAAO,IAAI,CAAC;AACd,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import * as e2e from "./module";
2
+ export default e2e;
3
+ export * from "./module";
package/lib/index.js ADDED
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
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
+ })();
35
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ const e2e = __importStar(require("./module"));
40
+ exports.default = e2e;
41
+ __exportStar(require("./module"), exports);
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAgC;AAEhC,kBAAe,GAAG,CAAC;AACnB,2CAAyB"}
@@ -0,0 +1 @@
1
+ export declare const json_equal_to: (exception: (key: string) => boolean) => <T>(x: T) => (y: T | null | undefined) => string[];
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.json_equal_to = void 0;
4
+ const json_equal_to = (exception) => (x) => (y) => {
5
+ const container = [];
6
+ const iterate = (accessor) => (x) => (y) => {
7
+ if (typeof x === "function" || typeof y === "function")
8
+ return;
9
+ else if (typeof x !== typeof y)
10
+ container.push(accessor);
11
+ else if (x instanceof Array)
12
+ if (!(y instanceof Array))
13
+ container.push(accessor);
14
+ else
15
+ array(accessor)(x)(y);
16
+ else if (x instanceof Object)
17
+ object(accessor)(x)(y);
18
+ else if (x !== y)
19
+ container.push(accessor);
20
+ };
21
+ const array = (accessor) => (x) => (y) => {
22
+ if (x.length !== y.length)
23
+ container.push(`${accessor}.length`);
24
+ x.forEach((xItem, i) => iterate(`${accessor}[${i}]`)(xItem)(y[i]));
25
+ };
26
+ const object = (accessor) => (x) => (y) => Object.keys(x)
27
+ .filter((key) => x[key] !== undefined && !exception(key))
28
+ .forEach((key) => iterate(`${accessor}.${key}`)(x[key])(y[key]));
29
+ iterate("")(x)(y);
30
+ return container;
31
+ };
32
+ exports.json_equal_to = json_equal_to;
33
+ //# sourceMappingURL=json_equal_to.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json_equal_to.js","sourceRoot":"","sources":["../../src/internal/json_equal_to.ts"],"names":[],"mappings":";;;AAAO,MAAM,aAAa,GACxB,CAAC,SAAmC,EAAE,EAAE,CACxC,CAAI,CAAI,EAAE,EAAE,CACZ,CAAC,CAAuB,EAAY,EAAE;IACpC,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,MAAM,OAAO,GACX,CAAC,QAAgB,EAAE,EAAE,CACrB,CAAC,CAAM,EAAE,EAAE,CACX,CAAC,CAAM,EAAQ,EAAE;QACf,IAAI,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,KAAK,UAAU;YAAE,OAAO;aAC1D,IAAI,OAAO,CAAC,KAAK,OAAO,CAAC;YAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aACpD,IAAI,CAAC,YAAY,KAAK;YACzB,IAAI,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC;gBAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;;gBAC/C,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACxB,IAAI,CAAC,YAAY,MAAM;YAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAChD,IAAI,CAAC,KAAK,CAAC;YAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC,CAAC;IACJ,MAAM,KAAK,GACT,CAAC,QAAgB,EAAE,EAAE,CACrB,CAAC,CAAQ,EAAE,EAAE,CACb,CAAC,CAAQ,EAAQ,EAAE;QACjB,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;YAAE,SAAS,CAAC,IAAI,CAAC,GAAG,QAAQ,SAAS,CAAC,CAAC;QAChE,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,QAAQ,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC,CAAC;IACJ,MAAM,MAAM,GACV,CAAC,QAAgB,EAAE,EAAE,CACrB,CAAC,CAAM,EAAE,EAAE,CACX,CAAC,CAAM,EAAQ,EAAE,CACf,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;SACX,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;SACxD,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,QAAQ,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAEvE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClB,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAlCS,QAAA,aAAa,iBAkCtB"}
@@ -0,0 +1,6 @@
1
+ export * from "./ArrayUtil";
2
+ export * from "./MapUtil";
3
+ export * from "./RandomGenerator";
4
+ export * from "./DynamicExecutor";
5
+ export * from "./GaffComparator";
6
+ export * from "./TestValidator";
package/lib/module.js ADDED
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ArrayUtil"), exports);
18
+ __exportStar(require("./MapUtil"), exports);
19
+ __exportStar(require("./RandomGenerator"), exports);
20
+ __exportStar(require("./DynamicExecutor"), exports);
21
+ __exportStar(require("./GaffComparator"), exports);
22
+ __exportStar(require("./TestValidator"), exports);
23
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,4CAA0B;AAC1B,oDAAkC;AAElC,oDAAkC;AAClC,mDAAiC;AACjC,kDAAgC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/e2e",
3
- "version": "11.0.0-dev.20260305",
3
+ "version": "11.0.0-dev.20260312",
4
4
  "description": "E2E test utilify functions",
5
5
  "main": "lib/index.js",
6
6
  "exports": {