@nestia/e2e 10.0.1 → 11.0.0-dev.20260305

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,643 +0,0 @@
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
- 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 = 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
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __values = (this && this.__values) || function(o) {
39
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
40
- if (m) return m.call(o);
41
- if (o && typeof o.length === "number") return {
42
- next: function () {
43
- if (o && i >= o.length) o = void 0;
44
- return { value: o && o[i++], done: !o };
45
- }
46
- };
47
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
48
- };
49
- var __read = (this && this.__read) || function (o, n) {
50
- var m = typeof Symbol === "function" && o[Symbol.iterator];
51
- if (!m) return o;
52
- var i = m.call(o), r, ar = [], e;
53
- try {
54
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
55
- }
56
- catch (error) { e = { error: error }; }
57
- finally {
58
- try {
59
- if (r && !r.done && (m = i["return"])) m.call(i);
60
- }
61
- finally { if (e) throw e.error; }
62
- }
63
- return ar;
64
- };
65
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
66
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
67
- if (ar || !(i in from)) {
68
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
69
- ar[i] = from[i];
70
- }
71
- }
72
- return to.concat(ar || Array.prototype.slice.call(from));
73
- };
74
- Object.defineProperty(exports, "__esModule", { value: true });
75
- exports.TestValidator = void 0;
76
- var RandomGenerator_1 = require("./RandomGenerator");
77
- var json_equal_to_1 = require("./internal/json_equal_to");
78
- /**
79
- * A comprehensive collection of E2E validation utilities for testing
80
- * applications.
81
- *
82
- * TestValidator provides type-safe validation functions for common testing
83
- * scenarios including condition checking, equality validation, error testing,
84
- * HTTP error validation, pagination testing, search functionality validation,
85
- * and sorting validation.
86
- *
87
- * Most functions use direct parameter passing for simplicity, while some
88
- * maintain currying patterns for advanced composition. All provide detailed
89
- * error messages for debugging failed assertions.
90
- *
91
- * @author Jeongho Nam - https://github.com/samchon
92
- * @example
93
- * ```typescript
94
- * // Basic condition testing
95
- * TestValidator.predicate("user should be authenticated", user.isAuthenticated);
96
- *
97
- * // Equality validation
98
- * TestValidator.equals("API response should match expected", x, y);
99
- *
100
- * // Error validation
101
- * TestValidator.error("should throw on invalid input", () => assertInput(""));
102
- * ```;
103
- */
104
- var TestValidator;
105
- (function (TestValidator) {
106
- var _this = this;
107
- /**
108
- * Validates that a given condition evaluates to true.
109
- *
110
- * Supports synchronous boolean values, synchronous functions returning
111
- * boolean, and asynchronous functions returning Promise<boolean>. The return
112
- * type is automatically inferred based on the input type.
113
- *
114
- * @example
115
- * ```typescript
116
- * // Synchronous boolean
117
- * TestValidator.predicate("user should exist", user !== null);
118
- *
119
- * // Synchronous function
120
- * TestValidator.predicate("array should be empty", () => arr.length === 0);
121
- *
122
- * // Asynchronous function
123
- * await TestValidator.predicate("database should be connected",
124
- * async () => await db.ping()
125
- * );
126
- * ```;
127
- *
128
- * @param title - Descriptive title used in error messages when validation
129
- * fails
130
- * @param condition - The condition to validate (boolean, function, or async
131
- * function)
132
- * @returns Void or Promise<void> based on the input type
133
- * @throws Error with descriptive message when condition is not satisfied
134
- */
135
- function predicate(title, condition) {
136
- var message = function () {
137
- return "Bug on ".concat(title, ": expected condition is not satisfied.");
138
- };
139
- // SCALAR
140
- if (typeof condition === "boolean") {
141
- if (condition !== true)
142
- throw new Error(message());
143
- return undefined;
144
- }
145
- // CLOSURE
146
- var output = condition();
147
- if (typeof output === "boolean") {
148
- if (output !== true)
149
- throw new Error(message());
150
- return undefined;
151
- }
152
- // ASYNCHRONOUS
153
- return new Promise(function (resolve, reject) {
154
- output
155
- .then(function (flag) {
156
- if (flag === true)
157
- resolve();
158
- else
159
- reject(message());
160
- })
161
- .catch(reject);
162
- });
163
- }
164
- TestValidator.predicate = predicate;
165
- /**
166
- * Validates deep equality between two values using JSON comparison.
167
- *
168
- * Performs recursive comparison of objects and arrays. Supports an optional
169
- * exception filter to ignore specific keys during comparison. Useful for
170
- * validating API responses, data transformations, and object state changes.
171
- *
172
- * @example
173
- * ```typescript
174
- * // Basic equality
175
- * TestValidator.equals("response should match expected", expectedUser, actualUser);
176
- *
177
- * // Ignore timestamps in comparison
178
- * TestValidator.equals("user data should match", expectedUser, actualUser,
179
- * (key) => key === "updatedAt"
180
- * );
181
- *
182
- * // Validate API response structure
183
- * TestValidator.equals("API response structure",
184
- * { id: 1, name: "John" },
185
- * { id: 1, name: "John" }
186
- * );
187
- *
188
- * // Type-safe nullable comparisons
189
- * const nullableData: { name: string } | null = getData();
190
- * TestValidator.equals("nullable check", nullableData, null);
191
- * ```;
192
- *
193
- * @param title - Descriptive title used in error messages when values differ
194
- * @param X - The first value to compare
195
- * @param y - The second value to compare (can be null or undefined)
196
- * @param exception - Optional filter function to exclude specific keys from
197
- * comparison
198
- * @throws Error with detailed diff information when values are not equal
199
- */
200
- function equals(title, X, y, exception) {
201
- var diff = (0, json_equal_to_1.json_equal_to)(exception !== null && exception !== void 0 ? exception : (function () { return false; }))(X)(y);
202
- if (diff.length)
203
- throw new Error([
204
- "Bug on ".concat(title, ": found different values - [").concat(diff.join(", "), "]:"),
205
- "\n",
206
- JSON.stringify({ x: X, y: y }, null, 2),
207
- ].join("\n"));
208
- }
209
- TestValidator.equals = equals;
210
- /**
211
- * Validates deep inequality between two values using JSON comparison.
212
- *
213
- * Performs recursive comparison of objects and arrays to ensure they are NOT
214
- * equal. Supports an optional exception filter to ignore specific keys during
215
- * comparison. Useful for validating that data has changed, objects are
216
- * different, or mutations have occurred.
217
- *
218
- * @example
219
- * ```typescript
220
- * // Basic inequality
221
- * TestValidator.notEquals("user should be different after update", originalUser, updatedUser);
222
- *
223
- * // Ignore timestamps in comparison
224
- * TestValidator.notEquals("user data should differ", originalUser, modifiedUser,
225
- * (key) => key === "updatedAt"
226
- * );
227
- *
228
- * // Validate state changes
229
- * TestValidator.notEquals("state should have changed", initialState, currentState);
230
- *
231
- * // Type-safe nullable comparisons
232
- * const mutableData: { count: number } | null = getMutableData();
233
- * TestValidator.notEquals("should have changed", mutableData, null);
234
- * ```;
235
- *
236
- * @param title - Descriptive title used in error messages when values are
237
- * equal
238
- * @param x - The first value to compare
239
- * @param y - The second value to compare (can be null or undefined)
240
- * @param exception - Optional filter function to exclude specific keys from
241
- * comparison
242
- * @throws Error when values are equal (indicating validation failure)
243
- */
244
- function notEquals(title, x, y, exception) {
245
- var diff = (0, json_equal_to_1.json_equal_to)(exception !== null && exception !== void 0 ? exception : (function () { return false; }))(x)(y);
246
- if (diff.length === 0)
247
- throw new Error([
248
- "Bug on ".concat(title, ": values should be different but are equal:"),
249
- "\n",
250
- JSON.stringify({ x: x, y: y }, null, 2),
251
- ].join("\n"));
252
- }
253
- TestValidator.notEquals = notEquals;
254
- /**
255
- * Validates that a function throws an error or rejects when executed.
256
- *
257
- * Expects the provided function to fail. If the function executes
258
- * successfully without throwing an error or rejecting, this validator will
259
- * throw an exception. Supports both synchronous and asynchronous functions.
260
- *
261
- * @example
262
- * ```typescript
263
- * // Synchronous error validation
264
- * TestValidator.error("should reject invalid email",
265
- * () => validateEmail("invalid-email")
266
- * );
267
- *
268
- * // Asynchronous error validation
269
- * await TestValidator.error("should reject unauthorized access",
270
- * async () => await api.functional.getSecretData()
271
- * );
272
- *
273
- * // Validate input validation
274
- * TestValidator.error("should throw on empty string",
275
- * () => processRequiredInput("")
276
- * );
277
- * ```;
278
- *
279
- * @param title - Descriptive title used in error messages when no error
280
- * occurs
281
- * @param task - The function that should throw an error or reject
282
- * @returns Void or Promise<void> based on the input type
283
- * @throws Error when the task function does not throw an error or reject
284
- */
285
- function error(title, task) {
286
- var message = function () { return "Bug on ".concat(title, ": exception must be thrown."); };
287
- try {
288
- var output_1 = task();
289
- if (is_promise(output_1))
290
- return new Promise(function (resolve, reject) {
291
- return output_1.catch(function () { return resolve(); }).then(function () { return reject(message()); });
292
- });
293
- else
294
- throw new Error(message());
295
- }
296
- catch (_a) {
297
- return undefined;
298
- }
299
- }
300
- TestValidator.error = error;
301
- /**
302
- * Validates that a function throws an HTTP error with specific status codes.
303
- *
304
- * Specialized error validator for HTTP operations. Validates that the
305
- * function throws an HttpError with one of the specified status codes. Useful
306
- * for testing API endpoints, authentication, and authorization logic.
307
- *
308
- * @example
309
- * ```typescript
310
- * // Validate 401 Unauthorized
311
- * await TestValidator.httpError("should return 401 for invalid token", 401,
312
- * async () => await api.functional.getProtectedResource("invalid-token")
313
- * );
314
- *
315
- * // Validate multiple possible error codes
316
- * await TestValidator.httpError("should return client error", [400, 404, 422],
317
- * async () => await api.functional.updateNonexistentResource(data)
318
- * );
319
- *
320
- * // Validate server errors
321
- * TestValidator.httpError("should handle server errors", [500, 502, 503],
322
- * () => callFaultyEndpoint()
323
- * );
324
- * ```;
325
- *
326
- * @param title - Descriptive title used in error messages
327
- * @param status - Expected status code(s), can be a single number or array
328
- * @param task - The function that should throw an HttpError
329
- * @returns Void or Promise<void> based on the input type
330
- * @throws Error when function doesn't throw HttpError or status code doesn't
331
- * match
332
- */
333
- function httpError(title, status, task) {
334
- if (typeof status === "number")
335
- status = [status];
336
- var message = function (actual) {
337
- return typeof actual === "number"
338
- ? "Bug on ".concat(title, ": status code must be ").concat(status.join(" or "), ", but ").concat(actual, ".")
339
- : "Bug on ".concat(title, ": status code must be ").concat(status.join(" or "), ", but succeeded.");
340
- };
341
- var predicate = function (exp) {
342
- return typeof exp === "object" &&
343
- exp.constructor.name === "HttpError" &&
344
- status.some(function (val) { return val === exp.status; })
345
- ? null
346
- : new Error(message(typeof exp === "object" && exp.constructor.name === "HttpError"
347
- ? exp.status
348
- : undefined));
349
- };
350
- try {
351
- var output_2 = task();
352
- if (is_promise(output_2))
353
- return new Promise(function (resolve, reject) {
354
- return output_2
355
- .catch(function (exp) {
356
- var res = predicate(exp);
357
- if (res)
358
- reject(res);
359
- else
360
- resolve();
361
- })
362
- .then(function () { return reject(new Error(message())); });
363
- });
364
- else
365
- throw new Error(message());
366
- }
367
- catch (exp) {
368
- var res = predicate(exp);
369
- if (res)
370
- throw res;
371
- return undefined;
372
- }
373
- }
374
- TestValidator.httpError = httpError;
375
- /**
376
- * Validates pagination index API results against expected entity order.
377
- *
378
- * Compares the order of entities returned by a pagination API with manually
379
- * sorted expected results. Validates that entity IDs appear in the correct
380
- * sequence. Commonly used for testing database queries, search results, and
381
- * any paginated data APIs.
382
- *
383
- * @example
384
- * ```typescript
385
- * // Test article pagination
386
- * const expectedArticles = await db.articles.findAll({ order: 'created_at DESC' });
387
- * const actualArticles = await api.functional.getArticles({ page: 1, limit: 10 });
388
- *
389
- * TestValidator.index("article pagination order", expectedArticles, actualArticles,
390
- * true // enable trace logging
391
- * );
392
- *
393
- * // Test user search results
394
- * const manuallyFilteredUsers = allUsers.filter(u => u.name.includes("John"));
395
- * const apiSearchResults = await api.functional.searchUsers({ query: "John" });
396
- *
397
- * TestValidator.index("user search results", manuallyFilteredUsers, apiSearchResults);
398
- * ```;
399
- *
400
- * @param title - Descriptive title used in error messages when order differs
401
- * @param expected - The expected entities in correct order
402
- * @param gotten - The actual entities returned by the API
403
- * @param trace - Optional flag to enable debug logging (default: false)
404
- * @throws Error when entity order differs between expected and actual results
405
- */
406
- TestValidator.index = function (title, expected, gotten, trace) {
407
- if (trace === void 0) { trace = false; }
408
- var length = Math.min(expected.length, gotten.length);
409
- expected = expected.slice(0, length);
410
- gotten = gotten.slice(0, length);
411
- var xIds = get_ids(expected).slice(0, length);
412
- var yIds = get_ids(gotten)
413
- .filter(function (id) { return id >= xIds[0]; })
414
- .slice(0, length);
415
- var equals = xIds.every(function (x, i) { return x === yIds[i]; });
416
- if (equals === true)
417
- return;
418
- else if (trace === true)
419
- console.log({
420
- expected: xIds,
421
- gotten: yIds,
422
- });
423
- throw new Error("Bug on ".concat(title, ": result of the index is different with manual aggregation."));
424
- };
425
- /**
426
- * Validates search functionality by testing API results against manual
427
- * filtering.
428
- *
429
- * Comprehensive search validation that samples entities from a complete
430
- * dataset, extracts search values, applies manual filtering, calls the search
431
- * API, and compares results. Validates that search APIs return the correct
432
- * subset of data matching the search criteria.
433
- *
434
- * @example
435
- * ```typescript
436
- * // Test article search functionality with exact matching
437
- * const allArticles = await db.articles.findAll();
438
- * const searchValidator = TestValidator.search(
439
- * "article search API",
440
- * (req) => api.searchArticles(req),
441
- * allArticles,
442
- * 5 // test with 5 random samples
443
- * );
444
- *
445
- * // Test exact match search
446
- * await searchValidator({
447
- * fields: ["title"],
448
- * values: (article) => [article.title], // full title for exact match
449
- * filter: (article, [title]) => article.title === title, // exact match
450
- * request: ([title]) => ({ search: { title } })
451
- * });
452
- *
453
- * // Test partial match search with includes
454
- * await searchValidator({
455
- * fields: ["content"],
456
- * values: (article) => [article.content.substring(0, 20)], // partial content
457
- * filter: (article, [keyword]) => article.content.includes(keyword),
458
- * request: ([keyword]) => ({ q: keyword })
459
- * });
460
- *
461
- * // Test multi-field search with exact matching
462
- * await searchValidator({
463
- * fields: ["writer", "title"],
464
- * values: (article) => [article.writer, article.title],
465
- * filter: (article, [writer, title]) =>
466
- * article.writer === writer && article.title === title,
467
- * request: ([writer, title]) => ({ search: { writer, title } })
468
- * });
469
- * ```;
470
- *
471
- * @param title - Descriptive title used in error messages when search fails
472
- * @param getter - API function that performs the search
473
- * @param total - Complete dataset to sample from for testing
474
- * @param sampleCount - Number of random samples to test (default: 1)
475
- * @returns A function that accepts search configuration properties
476
- * @throws Error when API search results don't match manual filtering results
477
- */
478
- TestValidator.search = function (title, getter, total, sampleCount) {
479
- if (sampleCount === void 0) { sampleCount = 1; }
480
- return function (props) { return __awaiter(_this, void 0, void 0, function () {
481
- var samples, _loop_1, samples_1, samples_1_1, s, e_1_1;
482
- var e_1, _a;
483
- return __generator(this, function (_b) {
484
- switch (_b.label) {
485
- case 0:
486
- samples = RandomGenerator_1.RandomGenerator.sample(total, sampleCount);
487
- _loop_1 = function (s) {
488
- var values, filtered, gotten;
489
- return __generator(this, function (_c) {
490
- switch (_c.label) {
491
- case 0:
492
- values = props.values(s);
493
- filtered = total.filter(function (entity) {
494
- return props.filter(entity, values);
495
- });
496
- return [4 /*yield*/, getter(props.request(values))];
497
- case 1:
498
- gotten = _c.sent();
499
- TestValidator.index("".concat(title, " (").concat(props.fields.join(", "), ")"), filtered, gotten);
500
- return [2 /*return*/];
501
- }
502
- });
503
- };
504
- _b.label = 1;
505
- case 1:
506
- _b.trys.push([1, 6, 7, 8]);
507
- samples_1 = __values(samples), samples_1_1 = samples_1.next();
508
- _b.label = 2;
509
- case 2:
510
- if (!!samples_1_1.done) return [3 /*break*/, 5];
511
- s = samples_1_1.value;
512
- return [5 /*yield**/, _loop_1(s)];
513
- case 3:
514
- _b.sent();
515
- _b.label = 4;
516
- case 4:
517
- samples_1_1 = samples_1.next();
518
- return [3 /*break*/, 2];
519
- case 5: return [3 /*break*/, 8];
520
- case 6:
521
- e_1_1 = _b.sent();
522
- e_1 = { error: e_1_1 };
523
- return [3 /*break*/, 8];
524
- case 7:
525
- try {
526
- if (samples_1_1 && !samples_1_1.done && (_a = samples_1.return)) _a.call(samples_1);
527
- }
528
- finally { if (e_1) throw e_1.error; }
529
- return [7 /*endfinally*/];
530
- case 8: return [2 /*return*/];
531
- }
532
- });
533
- }); };
534
- };
535
- /**
536
- * Validates sorting functionality of pagination APIs.
537
- *
538
- * Tests sorting operations by calling the API with sort parameters and
539
- * validating that results are correctly ordered. Supports multiple fields,
540
- * ascending/descending order, and optional filtering. Provides detailed error
541
- * reporting for sorting failures.
542
- *
543
- * @example
544
- * ```typescript
545
- * // Test single field sorting with GaffComparator
546
- * const sortValidator = TestValidator.sort(
547
- * "article sorting",
548
- * (sortable) => api.getArticles({ sort: sortable })
549
- * )("created_at")(
550
- * GaffComparator.dates((a) => a.created_at)
551
- * );
552
- *
553
- * await sortValidator("+"); // ascending
554
- * await sortValidator("-"); // descending
555
- *
556
- * // Test multi-field sorting with GaffComparator
557
- * const userSortValidator = TestValidator.sort(
558
- * "user sorting",
559
- * (sortable) => api.getUsers({ sort: sortable })
560
- * )("lastName", "firstName")(
561
- * GaffComparator.strings((user) => [user.lastName, user.firstName]),
562
- * (user) => user.isActive // only test active users
563
- * );
564
- *
565
- * await userSortValidator("+", true); // ascending with trace logging
566
- *
567
- * // Custom comparator for complex logic
568
- * const customSortValidator = TestValidator.sort(
569
- * "custom sorting",
570
- * (sortable) => api.getProducts({ sort: sortable })
571
- * )("price", "rating")(
572
- * (a, b) => {
573
- * const priceDiff = a.price - b.price;
574
- * return priceDiff !== 0 ? priceDiff : b.rating - a.rating; // price asc, rating desc
575
- * }
576
- * );
577
- * ```;
578
- *
579
- * @param title - Descriptive title used in error messages when sorting fails
580
- * @param getter - API function that fetches sorted data
581
- * @returns A currying function chain: field names, comparator, then direction
582
- * @throws Error when API results are not properly sorted according to
583
- * specification
584
- */
585
- TestValidator.sort = function (title, getter) {
586
- return function () {
587
- var fields = [];
588
- for (var _i = 0; _i < arguments.length; _i++) {
589
- fields[_i] = arguments[_i];
590
- }
591
- return function (comp, filter) {
592
- return function (direction_1) {
593
- var args_1 = [];
594
- for (var _i = 1; _i < arguments.length; _i++) {
595
- args_1[_i - 1] = arguments[_i];
596
- }
597
- return __awaiter(_this, __spreadArray([direction_1], __read(args_1), false), void 0, function (direction, trace) {
598
- var data, reversed;
599
- if (trace === void 0) { trace = false; }
600
- return __generator(this, function (_a) {
601
- switch (_a.label) {
602
- case 0: return [4 /*yield*/, getter(fields.map(function (field) { return "".concat(direction).concat(field); }))];
603
- case 1:
604
- data = _a.sent();
605
- if (filter)
606
- data = data.filter(filter);
607
- reversed = direction === "+" ? comp : function (x, y) { return comp(y, x); };
608
- if (is_sorted(data, reversed) === false) {
609
- if (fields.length === 1 &&
610
- data.length &&
611
- data[0][fields[0]] !== undefined &&
612
- trace)
613
- console.log(data.map(function (elem) { return elem[fields[0]]; }));
614
- throw new Error("Bug on ".concat(title, ": wrong sorting on ").concat(direction, "(").concat(fields.join(", "), ")."));
615
- }
616
- return [2 /*return*/];
617
- }
618
- });
619
- });
620
- };
621
- };
622
- };
623
- };
624
- })(TestValidator || (exports.TestValidator = TestValidator = {}));
625
- /** @internal */
626
- function get_ids(entities) {
627
- return entities.map(function (entity) { return entity.id; }).sort(function (x, y) { return (x < y ? -1 : 1); });
628
- }
629
- /** @internal */
630
- function is_promise(input) {
631
- return (typeof input === "object" &&
632
- input !== null &&
633
- typeof input.then === "function" &&
634
- typeof input.catch === "function");
635
- }
636
- /** @internal */
637
- function is_sorted(data, comp) {
638
- for (var i = 1; i < data.length; ++i)
639
- if (comp(data[i - 1], data[i]) > 0)
640
- return false;
641
- return true;
642
- }
643
- //# sourceMappingURL=TestValidator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TestValidator.js","sourceRoot":"","sources":["../src/TestValidator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAoD;AACpD,0DAAyD;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,IAAiB,aAAa,CAmkB7B;AAnkBD,WAAiB,aAAa;;IAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,SAAgB,SAAS,CAGvB,KAAa,EACb,SAAY;QAEZ,IAAM,OAAO,GAAG;YACd,OAAA,iBAAU,KAAK,2CAAwC;QAAvD,CAAuD,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;QAC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