@japa/runner 3.0.3 → 3.0.5
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/build/chunk-52OY4QRJ.js +284 -0
- package/build/chunk-52OY4QRJ.js.map +1 -0
- package/build/chunk-CXTCA2MO.js +503 -0
- package/build/chunk-CXTCA2MO.js.map +1 -0
- package/build/chunk-MWYEWO7K.js +18 -0
- package/build/chunk-MWYEWO7K.js.map +1 -0
- package/build/chunk-PKOB3ULJ.js +270 -0
- package/build/chunk-PKOB3ULJ.js.map +1 -0
- package/build/factories/main.js +214 -29
- package/build/factories/main.js.map +1 -0
- package/build/index.js +243 -202
- package/build/index.js.map +1 -0
- package/build/modules/core/main.d.ts +0 -1
- package/build/modules/core/main.js +22 -121
- package/build/modules/core/main.js.map +1 -0
- package/build/src/reporters/main.js +12 -37
- package/build/src/reporters/main.js.map +1 -0
- package/build/src/types.js +15 -9
- package/build/src/types.js.map +1 -0
- package/package.json +32 -16
- package/build/factories/create_diverse_tests.js +0 -106
- package/build/factories/runner.js +0 -93
- package/build/modules/core/reporters/base.js +0 -183
- package/build/modules/core/types.js +0 -9
- package/build/src/cli_parser.js +0 -75
- package/build/src/config_manager.js +0 -168
- package/build/src/create_test.js +0 -53
- package/build/src/debug.js +0 -10
- package/build/src/exceptions_manager.js +0 -85
- package/build/src/files_manager.js +0 -57
- package/build/src/helpers.js +0 -34
- package/build/src/hooks.js +0 -46
- package/build/src/planner.js +0 -98
- package/build/src/plugins/retry.js +0 -74
- package/build/src/reporters/dot.js +0 -41
- package/build/src/reporters/ndjson.js +0 -86
- package/build/src/reporters/spec.js +0 -152
- package/build/src/validator.js +0 -85
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dot,
|
|
3
|
+
ndjson,
|
|
4
|
+
spec
|
|
5
|
+
} from "./chunk-52OY4QRJ.js";
|
|
6
|
+
import {
|
|
7
|
+
Group,
|
|
8
|
+
Refiner,
|
|
9
|
+
Test,
|
|
10
|
+
TestContext
|
|
11
|
+
} from "./chunk-PKOB3ULJ.js";
|
|
12
|
+
|
|
13
|
+
// src/debug.ts
|
|
14
|
+
import { debuglog } from "node:util";
|
|
15
|
+
var debug_default = debuglog("japa:runner");
|
|
16
|
+
|
|
17
|
+
// src/validator.ts
|
|
18
|
+
var Validator = class {
|
|
19
|
+
/**
|
|
20
|
+
* Ensures the japa is configured. Otherwise raises an exception
|
|
21
|
+
*/
|
|
22
|
+
ensureIsConfigured(config) {
|
|
23
|
+
if (!config) {
|
|
24
|
+
throw new Error(
|
|
25
|
+
`Cannot run tests. Make sure to call "configure" method before the "run" method`
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Ensures the japa is in planning phase
|
|
31
|
+
*/
|
|
32
|
+
ensureIsInPlanningPhase(phase) {
|
|
33
|
+
if (phase !== "planning") {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`Cannot import japa test file directly. It must be imported by calling the "japa.run" method`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Ensures the suites filter uses a subset of the user configured suites.
|
|
41
|
+
*/
|
|
42
|
+
validateSuitesFilter(config) {
|
|
43
|
+
if (!config.filters.suites || !config.filters.suites.length) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (!("suites" in config) || !config.suites.length) {
|
|
47
|
+
throw new Error(`Cannot apply suites filter. You have not configured any test suites`);
|
|
48
|
+
}
|
|
49
|
+
const suites = config.suites.map(({ name }) => name);
|
|
50
|
+
const unknownSuites = config.filters.suites.filter((suite) => !suites.includes(suite));
|
|
51
|
+
if (unknownSuites.length) {
|
|
52
|
+
throw new Error(`Cannot apply suites filter. "${unknownSuites[0]}" suite is not configured`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Ensure there are unique suites
|
|
57
|
+
*/
|
|
58
|
+
validateSuitesForUniqueness(config) {
|
|
59
|
+
if (!("suites" in config)) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const suites = /* @__PURE__ */ new Set();
|
|
63
|
+
config.suites.forEach(({ name }) => {
|
|
64
|
+
if (suites.has(name)) {
|
|
65
|
+
throw new Error(`Duplicate suite "${name}"`);
|
|
66
|
+
}
|
|
67
|
+
suites.add(name);
|
|
68
|
+
});
|
|
69
|
+
suites.clear();
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Ensure the activated reporters are in the list of defined
|
|
73
|
+
* reporters
|
|
74
|
+
*/
|
|
75
|
+
validateActivatedReporters(config) {
|
|
76
|
+
const reportersList = config.reporters.list.map(({ name }) => name);
|
|
77
|
+
const unknownReporters = config.reporters.activated.filter(
|
|
78
|
+
(name) => !reportersList.includes(name)
|
|
79
|
+
);
|
|
80
|
+
if (unknownReporters.length) {
|
|
81
|
+
throw new Error(
|
|
82
|
+
`Invalid reporter "${unknownReporters[0]}". Make sure to register it first inside the "reporters.list" array`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var validator_default = new Validator();
|
|
88
|
+
|
|
89
|
+
// src/files_manager.ts
|
|
90
|
+
import slash from "slash";
|
|
91
|
+
import fastGlob from "fast-glob";
|
|
92
|
+
import { pathToFileURL } from "node:url";
|
|
93
|
+
var FILE_SUFFIX_EXPRESSION = /(\.spec|\.test)?\.[js|ts|jsx|tsx|mjs|mts|cjs|cts]+$/;
|
|
94
|
+
var FilesManager = class {
|
|
95
|
+
/**
|
|
96
|
+
* Returns a collection of files from the user defined
|
|
97
|
+
* glob or the implementation function
|
|
98
|
+
*/
|
|
99
|
+
async getFiles(cwd, files) {
|
|
100
|
+
if (Array.isArray(files) || typeof files === "string") {
|
|
101
|
+
const testFiles = await fastGlob(files, {
|
|
102
|
+
absolute: true,
|
|
103
|
+
onlyFiles: true,
|
|
104
|
+
cwd
|
|
105
|
+
});
|
|
106
|
+
return testFiles.map((file) => pathToFileURL(file));
|
|
107
|
+
}
|
|
108
|
+
return await files();
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Applies file name filter on a collection of file
|
|
112
|
+
* URLs
|
|
113
|
+
*/
|
|
114
|
+
grep(files, filters) {
|
|
115
|
+
return files.filter((file) => {
|
|
116
|
+
const filename = slash(file.pathname);
|
|
117
|
+
const filenameWithoutTestSuffix = filename.replace(FILE_SUFFIX_EXPRESSION, "");
|
|
118
|
+
return !!filters.find((filter) => {
|
|
119
|
+
if (filename.endsWith(filter)) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
const filterSegments = filter.split("/").reverse();
|
|
123
|
+
const fileSegments = filenameWithoutTestSuffix.split("/").reverse();
|
|
124
|
+
return filterSegments.every((segment, index) => {
|
|
125
|
+
return fileSegments[index] && (segment === "*" || fileSegments[index].endsWith(segment));
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
// src/planner.ts
|
|
133
|
+
var Planner = class {
|
|
134
|
+
#config;
|
|
135
|
+
#fileManager = new FilesManager();
|
|
136
|
+
constructor(config) {
|
|
137
|
+
validator_default.validateActivatedReporters(config);
|
|
138
|
+
validator_default.validateSuitesFilter(config);
|
|
139
|
+
validator_default.validateSuitesForUniqueness(config);
|
|
140
|
+
this.#config = config;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Returns a list of reporters based upon the activated
|
|
144
|
+
* reporters list.
|
|
145
|
+
*/
|
|
146
|
+
#getActivatedReporters() {
|
|
147
|
+
return this.#config.reporters.activated.map((activated) => {
|
|
148
|
+
return this.#config.reporters.list.find(({ name }) => activated === name);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* A generic method to collect files from the user defined
|
|
153
|
+
* files glob and apply the files filter
|
|
154
|
+
*/
|
|
155
|
+
async #collectFiles(files) {
|
|
156
|
+
let filesURLs = await this.#fileManager.getFiles(this.#config.cwd, files);
|
|
157
|
+
if (this.#config.filters.files && this.#config.filters.files.length) {
|
|
158
|
+
filesURLs = this.#fileManager.grep(filesURLs, this.#config.filters.files);
|
|
159
|
+
}
|
|
160
|
+
return filesURLs;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Returns a collection of suites and their associated
|
|
164
|
+
* test files by applying all the filters
|
|
165
|
+
*/
|
|
166
|
+
async #getSuites() {
|
|
167
|
+
let suites = [];
|
|
168
|
+
let suitesFilters = this.#config.filters.suites || [];
|
|
169
|
+
if ("files" in this.#config) {
|
|
170
|
+
suites.push({
|
|
171
|
+
name: "default",
|
|
172
|
+
files: this.#config.files,
|
|
173
|
+
timeout: this.#config.timeout,
|
|
174
|
+
retries: this.#config.retries,
|
|
175
|
+
filesURLs: await this.#collectFiles(this.#config.files)
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
if ("suites" in this.#config) {
|
|
179
|
+
for (let suite of this.#config.suites) {
|
|
180
|
+
if (!suitesFilters.length || suitesFilters.includes(suite.name)) {
|
|
181
|
+
suites.push({
|
|
182
|
+
...suite,
|
|
183
|
+
filesURLs: await this.#collectFiles(suite.files)
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return suites;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Returns a list of filters to the passed to the refiner
|
|
192
|
+
*/
|
|
193
|
+
#getRefinerFilters() {
|
|
194
|
+
return Object.keys(this.#config.filters).reduce(
|
|
195
|
+
(result, layer) => {
|
|
196
|
+
if (layer === "tests" || layer === "tags" || layer === "groups") {
|
|
197
|
+
result.push({ layer, filters: this.#config.filters[layer] });
|
|
198
|
+
}
|
|
199
|
+
return result;
|
|
200
|
+
},
|
|
201
|
+
[]
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Creates a plan for running the tests
|
|
206
|
+
*/
|
|
207
|
+
async plan() {
|
|
208
|
+
const suites = await this.#getSuites();
|
|
209
|
+
const reporters = this.#getActivatedReporters();
|
|
210
|
+
const refinerFilters = this.#getRefinerFilters();
|
|
211
|
+
return {
|
|
212
|
+
reporters,
|
|
213
|
+
suites,
|
|
214
|
+
refinerFilters,
|
|
215
|
+
config: this.#config
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
// src/hooks.ts
|
|
221
|
+
import Hooks from "@poppinss/hooks";
|
|
222
|
+
var GlobalHooks = class {
|
|
223
|
+
#hooks = new Hooks();
|
|
224
|
+
#setupRunner;
|
|
225
|
+
#teardownRunner;
|
|
226
|
+
/**
|
|
227
|
+
* Apply hooks from the config
|
|
228
|
+
*/
|
|
229
|
+
apply(config) {
|
|
230
|
+
config.setup.forEach((hook) => this.#hooks.add("setup", hook));
|
|
231
|
+
config.teardown.forEach((hook) => this.#hooks.add("teardown", hook));
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Perform setup
|
|
235
|
+
*/
|
|
236
|
+
async setup(runner) {
|
|
237
|
+
this.#setupRunner = this.#hooks.runner("setup");
|
|
238
|
+
this.#teardownRunner = this.#hooks.runner("teardown");
|
|
239
|
+
await this.#setupRunner.run(runner);
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Perform cleanup
|
|
243
|
+
*/
|
|
244
|
+
async teardown(error, runner) {
|
|
245
|
+
if (this.#setupRunner) {
|
|
246
|
+
await this.#setupRunner.cleanup(error, runner);
|
|
247
|
+
}
|
|
248
|
+
if (this.#teardownRunner) {
|
|
249
|
+
if (!error) {
|
|
250
|
+
await this.#teardownRunner.run(runner);
|
|
251
|
+
}
|
|
252
|
+
await this.#teardownRunner.cleanup(error, runner);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
// src/cli_parser.ts
|
|
258
|
+
import getopts from "getopts";
|
|
259
|
+
import colors from "@poppinss/colors";
|
|
260
|
+
var ansi = colors.ansi();
|
|
261
|
+
var OPTIONS = {
|
|
262
|
+
string: ["tests", "groups", "tags", "files", "timeout", "retries", "reporters", "failed"],
|
|
263
|
+
boolean: ["help", "matchAll", "failed"],
|
|
264
|
+
alias: {
|
|
265
|
+
forceExit: "force-exit",
|
|
266
|
+
matchAll: "match-all",
|
|
267
|
+
help: "h"
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
var GET_HELP = () => `
|
|
271
|
+
${ansi.yellow("@japa/runner v2.3.0")}
|
|
272
|
+
|
|
273
|
+
${ansi.green("--tests")} ${ansi.dim("Filter tests by the test title")}
|
|
274
|
+
${ansi.green("--groups")} ${ansi.dim("Filter tests by the group title")}
|
|
275
|
+
${ansi.green("--tags")} ${ansi.dim("Filter tests by tags")}
|
|
276
|
+
${ansi.green("--files")} ${ansi.dim("Filter tests by the file name")}
|
|
277
|
+
${ansi.green("--force-exit")} ${ansi.dim("Forcefully exit the process")}
|
|
278
|
+
${ansi.green("--timeout")} ${ansi.dim("Define default timeout for all tests")}
|
|
279
|
+
${ansi.green("--retries")} ${ansi.dim("Define default retries for all tests")}
|
|
280
|
+
${ansi.green("--reporters")} ${ansi.dim("Activate one or more test reporters")}
|
|
281
|
+
${ansi.green("--failed")} ${ansi.dim("Run tests failed during the last run")}
|
|
282
|
+
${ansi.green("-h, --help")} ${ansi.dim("View help")}
|
|
283
|
+
|
|
284
|
+
${ansi.yellow("Examples:")}
|
|
285
|
+
${ansi.dim('node bin/test.js --tags="@github"')}
|
|
286
|
+
${ansi.dim('node bin/test.js --tags="~@github"')}
|
|
287
|
+
${ansi.dim('node bin/test.js --tags="@github,@slow,@integration" --match-all')}
|
|
288
|
+
${ansi.dim("node bin/test.js --force-exit")}
|
|
289
|
+
${ansi.dim('node bin/test.js --files="user"')}
|
|
290
|
+
${ansi.dim('node bin/test.js --files="functional/user"')}
|
|
291
|
+
${ansi.dim('node bin/test.js --files="unit/user"')}
|
|
292
|
+
|
|
293
|
+
${ansi.yellow("Notes:")}
|
|
294
|
+
- When groups and tests filters are applied together. We will first filter the
|
|
295
|
+
tests by group title and then apply the tests title filter.
|
|
296
|
+
- The timeout defined on test object takes precedence over the ${ansi.green("--timeout")} flag.
|
|
297
|
+
- The retries defined on test object takes precedence over the ${ansi.green("--retries")} flag.
|
|
298
|
+
- The ${ansi.green("--files")} flag checks for the file names ending with the filter substring.
|
|
299
|
+
`;
|
|
300
|
+
var CliParser = class {
|
|
301
|
+
/**
|
|
302
|
+
* Parses command-line arguments
|
|
303
|
+
*/
|
|
304
|
+
parse(argv) {
|
|
305
|
+
return getopts(argv, OPTIONS);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Returns the help string
|
|
309
|
+
*/
|
|
310
|
+
getHelp() {
|
|
311
|
+
return GET_HELP();
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
// src/config_manager.ts
|
|
316
|
+
var NOOP = () => {
|
|
317
|
+
};
|
|
318
|
+
var DEFAULTS = {
|
|
319
|
+
files: [],
|
|
320
|
+
timeout: 2e3,
|
|
321
|
+
retries: 0,
|
|
322
|
+
forceExit: false,
|
|
323
|
+
plugins: [],
|
|
324
|
+
reporters: {
|
|
325
|
+
activated: ["spec"],
|
|
326
|
+
list: [spec(), ndjson(), dot()]
|
|
327
|
+
},
|
|
328
|
+
importer: (filePath) => import(filePath.href),
|
|
329
|
+
configureSuite: () => {
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
var ConfigManager = class {
|
|
333
|
+
#config;
|
|
334
|
+
#cliArgs;
|
|
335
|
+
constructor(config, cliArgs) {
|
|
336
|
+
this.#config = config;
|
|
337
|
+
this.#cliArgs = cliArgs;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Processes a CLI argument and converts it to an
|
|
341
|
+
* array of strings
|
|
342
|
+
*/
|
|
343
|
+
#processAsArray(value) {
|
|
344
|
+
return Array.isArray(value) ? value : value.split(",").map((item) => item.trim());
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Returns a copy of filters based upon the CLI
|
|
348
|
+
* arguments.
|
|
349
|
+
*/
|
|
350
|
+
#getCLIFilters() {
|
|
351
|
+
const filters = {};
|
|
352
|
+
if (this.#cliArgs.tags) {
|
|
353
|
+
filters.tags = this.#processAsArray(this.#cliArgs.tags);
|
|
354
|
+
}
|
|
355
|
+
if (this.#cliArgs.tests) {
|
|
356
|
+
filters.tests = this.#processAsArray(this.#cliArgs.tests);
|
|
357
|
+
}
|
|
358
|
+
if (this.#cliArgs.files) {
|
|
359
|
+
filters.files = this.#processAsArray(this.#cliArgs.files);
|
|
360
|
+
}
|
|
361
|
+
if (this.#cliArgs.groups) {
|
|
362
|
+
filters.groups = this.#processAsArray(this.#cliArgs.groups);
|
|
363
|
+
}
|
|
364
|
+
if (this.#cliArgs._ && this.#cliArgs._.length) {
|
|
365
|
+
filters.suites = this.#processAsArray(this.#cliArgs._);
|
|
366
|
+
}
|
|
367
|
+
return filters;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Returns the timeout from the CLI args
|
|
371
|
+
*/
|
|
372
|
+
#getCLITimeout() {
|
|
373
|
+
if (this.#cliArgs.timeout) {
|
|
374
|
+
const value = Number(this.#cliArgs.timeout);
|
|
375
|
+
if (!Number.isNaN(value)) {
|
|
376
|
+
return value;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Returns the retries from the CLI args
|
|
382
|
+
*/
|
|
383
|
+
#getCLIRetries() {
|
|
384
|
+
if (this.#cliArgs.retries) {
|
|
385
|
+
const value = Number(this.#cliArgs.retries);
|
|
386
|
+
if (!Number.isNaN(value)) {
|
|
387
|
+
return value;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Returns the forceExit property from the CLI args
|
|
393
|
+
*/
|
|
394
|
+
#getCLIForceExit() {
|
|
395
|
+
if (this.#cliArgs.forceExit) {
|
|
396
|
+
return true;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Returns reporters selected using the commandline
|
|
401
|
+
* --reporter flag
|
|
402
|
+
*/
|
|
403
|
+
#getCLIReporters() {
|
|
404
|
+
if (this.#cliArgs.reporters) {
|
|
405
|
+
return this.#processAsArray(this.#cliArgs.reporters);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Hydrates the config with user defined options and the
|
|
410
|
+
* command-line flags.
|
|
411
|
+
*/
|
|
412
|
+
hydrate() {
|
|
413
|
+
const cliFilters = this.#getCLIFilters();
|
|
414
|
+
const cliRetries = this.#getCLIRetries();
|
|
415
|
+
const cliTimeout = this.#getCLITimeout();
|
|
416
|
+
const cliReporters = this.#getCLIReporters();
|
|
417
|
+
const cliForceExit = this.#getCLIForceExit();
|
|
418
|
+
debug_default("filters applied using CLI flags %O", cliFilters);
|
|
419
|
+
const baseConfig = {
|
|
420
|
+
cwd: this.#config.cwd ?? process.cwd(),
|
|
421
|
+
filters: Object.assign({}, this.#config.filters ?? {}, cliFilters),
|
|
422
|
+
importer: this.#config.importer ?? DEFAULTS.importer,
|
|
423
|
+
refiner: this.#config.refiner ?? new Refiner(),
|
|
424
|
+
retries: cliRetries ?? this.#config.retries ?? DEFAULTS.retries,
|
|
425
|
+
timeout: cliTimeout ?? this.#config.timeout ?? DEFAULTS.timeout,
|
|
426
|
+
plugins: this.#config.plugins ?? DEFAULTS.plugins,
|
|
427
|
+
forceExit: cliForceExit ?? this.#config.forceExit ?? DEFAULTS.forceExit,
|
|
428
|
+
reporters: this.#config.reporters ? {
|
|
429
|
+
activated: this.#config.reporters.activated,
|
|
430
|
+
list: this.#config.reporters.list || DEFAULTS.reporters.list
|
|
431
|
+
} : DEFAULTS.reporters,
|
|
432
|
+
configureSuite: this.#config.configureSuite ?? DEFAULTS.configureSuite,
|
|
433
|
+
setup: this.#config.setup || [],
|
|
434
|
+
teardown: this.#config.teardown || []
|
|
435
|
+
};
|
|
436
|
+
if (cliReporters) {
|
|
437
|
+
baseConfig.reporters.activated = cliReporters;
|
|
438
|
+
}
|
|
439
|
+
if ("files" in this.#config) {
|
|
440
|
+
return {
|
|
441
|
+
files: this.#config.files,
|
|
442
|
+
...baseConfig
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
return {
|
|
446
|
+
suites: this.#config.suites.map((suite) => {
|
|
447
|
+
return {
|
|
448
|
+
name: suite.name,
|
|
449
|
+
files: suite.files,
|
|
450
|
+
timeout: cliTimeout ?? suite.timeout ?? baseConfig.timeout,
|
|
451
|
+
retries: cliRetries ?? suite.retries ?? baseConfig.retries,
|
|
452
|
+
configure: suite.configure || NOOP
|
|
453
|
+
};
|
|
454
|
+
}),
|
|
455
|
+
...baseConfig
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
// src/create_test.ts
|
|
461
|
+
var contextBuilder = (testInstance) => new TestContext(testInstance);
|
|
462
|
+
function createTest(title, emitter, refiner, options) {
|
|
463
|
+
const testInstance = new Test(title, contextBuilder, emitter, refiner, options.group);
|
|
464
|
+
testInstance.options.meta.suite = options.suite;
|
|
465
|
+
testInstance.options.meta.group = options.group;
|
|
466
|
+
testInstance.options.meta.fileName = options.file;
|
|
467
|
+
if (options.timeout !== void 0) {
|
|
468
|
+
testInstance.timeout(options.timeout);
|
|
469
|
+
}
|
|
470
|
+
if (options.retries !== void 0) {
|
|
471
|
+
testInstance.retry(options.retries);
|
|
472
|
+
}
|
|
473
|
+
if (options.group) {
|
|
474
|
+
options.group.add(testInstance);
|
|
475
|
+
} else if (options.suite) {
|
|
476
|
+
options.suite.add(testInstance);
|
|
477
|
+
}
|
|
478
|
+
return testInstance;
|
|
479
|
+
}
|
|
480
|
+
function createTestGroup(title, emitter, refiner, options) {
|
|
481
|
+
if (options.group) {
|
|
482
|
+
throw new Error("Nested groups are not supported by Japa");
|
|
483
|
+
}
|
|
484
|
+
const group = new Group(title, emitter, refiner);
|
|
485
|
+
group.options.meta.suite = options.suite;
|
|
486
|
+
group.options.meta.fileName = options.file;
|
|
487
|
+
if (options.suite) {
|
|
488
|
+
options.suite.add(group);
|
|
489
|
+
}
|
|
490
|
+
return group;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
export {
|
|
494
|
+
debug_default,
|
|
495
|
+
validator_default,
|
|
496
|
+
Planner,
|
|
497
|
+
GlobalHooks,
|
|
498
|
+
CliParser,
|
|
499
|
+
ConfigManager,
|
|
500
|
+
createTest,
|
|
501
|
+
createTestGroup
|
|
502
|
+
};
|
|
503
|
+
//# sourceMappingURL=chunk-CXTCA2MO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/debug.ts","../src/validator.ts","../src/files_manager.ts","../src/planner.ts","../src/hooks.ts","../src/cli_parser.ts","../src/config_manager.ts","../src/create_test.ts"],"sourcesContent":["/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { debuglog } from 'node:util'\nexport default debuglog('japa:runner')\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { NormalizedConfig } from './types.js'\n\n/**\n * Validator encapsulates the validations to perform before running\n * the tests\n */\nclass Validator {\n /**\n * Ensures the japa is configured. Otherwise raises an exception\n */\n ensureIsConfigured(config: NormalizedConfig | undefined) {\n if (!config) {\n throw new Error(\n `Cannot run tests. Make sure to call \"configure\" method before the \"run\" method`\n )\n }\n }\n\n /**\n * Ensures the japa is in planning phase\n */\n ensureIsInPlanningPhase(phase: 'idle' | 'planning' | 'executing') {\n if (phase !== 'planning') {\n throw new Error(\n `Cannot import japa test file directly. It must be imported by calling the \"japa.run\" method`\n )\n }\n }\n\n /**\n * Ensures the suites filter uses a subset of the user configured suites.\n */\n validateSuitesFilter(config: NormalizedConfig) {\n /**\n * Do not perform any validation if no filters are applied\n * in the first place\n */\n if (!config.filters.suites || !config.filters.suites.length) {\n return\n }\n\n /**\n * Notify user they have applied the suites filter but forgot to define\n * suites\n */\n if (!('suites' in config) || !config.suites.length) {\n throw new Error(`Cannot apply suites filter. You have not configured any test suites`)\n }\n\n const suites = config.suites.map(({ name }) => name)\n\n /**\n * Find unknown suites and report the error\n */\n const unknownSuites = config.filters.suites.filter((suite) => !suites.includes(suite))\n if (unknownSuites.length) {\n throw new Error(`Cannot apply suites filter. \"${unknownSuites[0]}\" suite is not configured`)\n }\n }\n\n /**\n * Ensure there are unique suites\n */\n validateSuitesForUniqueness(config: NormalizedConfig) {\n if (!('suites' in config)) {\n return\n }\n\n const suites: Set<string> = new Set()\n config.suites.forEach(({ name }) => {\n if (suites.has(name)) {\n throw new Error(`Duplicate suite \"${name}\"`)\n }\n suites.add(name)\n })\n\n suites.clear()\n }\n\n /**\n * Ensure the activated reporters are in the list of defined\n * reporters\n */\n validateActivatedReporters(config: NormalizedConfig) {\n const reportersList = config.reporters.list.map(({ name }) => name)\n const unknownReporters = config.reporters.activated.filter(\n (name) => !reportersList.includes(name)\n )\n\n if (unknownReporters.length) {\n throw new Error(\n `Invalid reporter \"${unknownReporters[0]}\". Make sure to register it first inside the \"reporters.list\" array`\n )\n }\n }\n}\n\nexport default new Validator()\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport slash from 'slash'\nimport fastGlob from 'fast-glob'\nimport { pathToFileURL } from 'node:url'\nimport type { TestFiles } from './types.js'\n\n/**\n * The expression to remove file extension and optionally\n * .spec|.test from the test file name\n */\nconst FILE_SUFFIX_EXPRESSION = /(\\.spec|\\.test)?\\.[js|ts|jsx|tsx|mjs|mts|cjs|cts]+$/\n\n/**\n * Files manager exposes the API to collect, filter and import test\n * files based upon the config\n */\nexport class FilesManager {\n /**\n * Returns a collection of files from the user defined\n * glob or the implementation function\n */\n async getFiles(cwd: string, files: TestFiles): Promise<URL[]> {\n if (Array.isArray(files) || typeof files === 'string') {\n const testFiles = await fastGlob(files, {\n absolute: true,\n onlyFiles: true,\n cwd: cwd,\n })\n return testFiles.map((file) => pathToFileURL(file))\n }\n\n return await files()\n }\n\n /**\n * Applies file name filter on a collection of file\n * URLs\n */\n grep(files: URL[], filters: string[]): URL[] {\n return files.filter((file) => {\n const filename = slash(file.pathname)\n const filenameWithoutTestSuffix = filename.replace(FILE_SUFFIX_EXPRESSION, '')\n\n return !!filters.find((filter) => {\n if (filename.endsWith(filter)) {\n return true\n }\n\n const filterSegments = filter.split('/').reverse()\n const fileSegments = filenameWithoutTestSuffix.split('/').reverse()\n\n return filterSegments.every((segment, index) => {\n return fileSegments[index] && (segment === '*' || fileSegments[index].endsWith(segment))\n })\n })\n })\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport validator from './validator.js'\nimport { FilesManager } from './files_manager.js'\nimport type { NamedReporterContract, NormalizedConfig, TestFiles, TestSuite } from './types.js'\n\n/**\n * The tests planner is used to plan the tests by doing all\n * the heavy lifting of executing plugins, registering\n * reporters, filtering tests and so on.\n */\nexport class Planner {\n #config: NormalizedConfig\n #fileManager = new FilesManager()\n\n constructor(config: NormalizedConfig) {\n validator.validateActivatedReporters(config!)\n validator.validateSuitesFilter(config!)\n validator.validateSuitesForUniqueness(config!)\n this.#config = config\n }\n\n /**\n * Returns a list of reporters based upon the activated\n * reporters list.\n */\n #getActivatedReporters(): NamedReporterContract[] {\n return this.#config.reporters.activated.map((activated) => {\n return this.#config.reporters.list.find(({ name }) => activated === name)!\n })\n }\n\n /**\n * A generic method to collect files from the user defined\n * files glob and apply the files filter\n */\n async #collectFiles(files: TestFiles) {\n let filesURLs = await this.#fileManager.getFiles(this.#config.cwd, files)\n if (this.#config.filters.files && this.#config.filters.files.length) {\n filesURLs = this.#fileManager.grep(filesURLs, this.#config.filters.files)\n }\n\n return filesURLs\n }\n\n /**\n * Returns a collection of suites and their associated\n * test files by applying all the filters\n */\n async #getSuites(): Promise<(TestSuite & { filesURLs: URL[] })[]> {\n let suites: (TestSuite & { filesURLs: URL[] })[] = []\n let suitesFilters = this.#config.filters.suites || []\n\n if ('files' in this.#config) {\n suites.push({\n name: 'default',\n files: this.#config.files,\n timeout: this.#config.timeout,\n retries: this.#config.retries,\n filesURLs: await this.#collectFiles(this.#config.files),\n })\n }\n\n if ('suites' in this.#config) {\n for (let suite of this.#config.suites) {\n if (!suitesFilters.length || suitesFilters.includes(suite.name)) {\n suites.push({\n ...suite,\n filesURLs: await this.#collectFiles(suite.files),\n })\n }\n }\n }\n\n return suites\n }\n\n /**\n * Returns a list of filters to the passed to the refiner\n */\n #getRefinerFilters() {\n return Object.keys(this.#config.filters).reduce(\n (result, layer) => {\n if (layer === 'tests' || layer === 'tags' || layer === 'groups') {\n result.push({ layer, filters: this.#config.filters[layer]! })\n }\n return result\n },\n [] as { layer: 'tags' | 'tests' | 'groups'; filters: string[] }[]\n )\n }\n\n /**\n * Creates a plan for running the tests\n */\n async plan() {\n const suites = await this.#getSuites()\n const reporters = this.#getActivatedReporters()\n const refinerFilters = this.#getRefinerFilters()\n return {\n reporters,\n suites,\n refinerFilters,\n config: this.#config,\n }\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport Hooks from '@poppinss/hooks'\nimport type { Runner as HooksRunner } from '@poppinss/hooks/types'\n\nimport { Runner } from '../modules/core/main.js'\nimport type { HooksEvents, SetupHookState, NormalizedConfig, TeardownHookState } from './types.js'\n\n/**\n * Exposes API for working with global hooks\n */\nexport class GlobalHooks {\n #hooks = new Hooks<HooksEvents>()\n #setupRunner: HooksRunner<SetupHookState[0], SetupHookState[1]> | undefined\n #teardownRunner: HooksRunner<TeardownHookState[0], TeardownHookState[1]> | undefined\n\n /**\n * Apply hooks from the config\n */\n apply(config: NormalizedConfig) {\n config.setup.forEach((hook) => this.#hooks.add('setup', hook))\n config.teardown.forEach((hook) => this.#hooks.add('teardown', hook))\n }\n\n /**\n * Perform setup\n */\n async setup(runner: Runner) {\n this.#setupRunner = this.#hooks.runner('setup')\n this.#teardownRunner = this.#hooks.runner('teardown')\n await this.#setupRunner.run(runner)\n }\n\n /**\n * Perform cleanup\n */\n async teardown(error: Error | null, runner: Runner) {\n if (this.#setupRunner) {\n await this.#setupRunner.cleanup(error, runner)\n }\n if (this.#teardownRunner) {\n if (!error) {\n await this.#teardownRunner.run(runner)\n }\n await this.#teardownRunner.cleanup(error, runner)\n }\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n// @ts-ignore-error\nimport getopts from 'getopts'\nimport colors from '@poppinss/colors'\nimport type { CLIArgs } from './types.js'\n\nconst ansi = colors.ansi()\n\n/**\n * Known commandline options. The user can still define additional flags and they\n * will be parsed aswell, but without any normalization\n */\nconst OPTIONS = {\n string: ['tests', 'groups', 'tags', 'files', 'timeout', 'retries', 'reporters', 'failed'],\n boolean: ['help', 'matchAll', 'failed'],\n alias: {\n forceExit: 'force-exit',\n matchAll: 'match-all',\n help: 'h',\n },\n}\n\n/**\n * Help string to display when the `--help flag is used`\n */\nconst GET_HELP = () => `\n${ansi.yellow('@japa/runner v2.3.0')}\n\n${ansi.green('--tests')} ${ansi.dim('Filter tests by the test title')}\n${ansi.green('--groups')} ${ansi.dim('Filter tests by the group title')}\n${ansi.green('--tags')} ${ansi.dim('Filter tests by tags')}\n${ansi.green('--files')} ${ansi.dim('Filter tests by the file name')}\n${ansi.green('--force-exit')} ${ansi.dim('Forcefully exit the process')}\n${ansi.green('--timeout')} ${ansi.dim('Define default timeout for all tests')}\n${ansi.green('--retries')} ${ansi.dim('Define default retries for all tests')}\n${ansi.green('--reporters')} ${ansi.dim('Activate one or more test reporters')}\n${ansi.green('--failed')} ${ansi.dim('Run tests failed during the last run')}\n${ansi.green('-h, --help')} ${ansi.dim('View help')}\n\n${ansi.yellow('Examples:')}\n${ansi.dim('node bin/test.js --tags=\"@github\"')}\n${ansi.dim('node bin/test.js --tags=\"~@github\"')}\n${ansi.dim('node bin/test.js --tags=\"@github,@slow,@integration\" --match-all')}\n${ansi.dim('node bin/test.js --force-exit')}\n${ansi.dim('node bin/test.js --files=\"user\"')}\n${ansi.dim('node bin/test.js --files=\"functional/user\"')}\n${ansi.dim('node bin/test.js --files=\"unit/user\"')}\n\n${ansi.yellow('Notes:')}\n- When groups and tests filters are applied together. We will first filter the\n tests by group title and then apply the tests title filter.\n- The timeout defined on test object takes precedence over the ${ansi.green('--timeout')} flag.\n- The retries defined on test object takes precedence over the ${ansi.green('--retries')} flag.\n- The ${ansi.green('--files')} flag checks for the file names ending with the filter substring.\n`\n\n/**\n * CLI Parser is used to parse the commandline argument\n */\nexport class CliParser {\n /**\n * Parses command-line arguments\n */\n parse(argv: string[]): CLIArgs {\n return getopts(argv, OPTIONS)\n }\n\n /**\n * Returns the help string\n */\n getHelp() {\n return GET_HELP()\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport debug from './debug.js'\nimport { Refiner } from '../modules/core/main.js'\nimport { dot, ndjson, spec } from './reporters/main.js'\nimport type { CLIArgs, Config, Filters, NormalizedBaseConfig, NormalizedConfig } from './types.js'\n\nexport const NOOP = () => {}\n\n/**\n * Defaults to use for configuration\n */\nconst DEFAULTS = {\n files: [],\n timeout: 2000,\n retries: 0,\n forceExit: false,\n plugins: [],\n reporters: {\n activated: ['spec'],\n list: [spec(), ndjson(), dot()],\n },\n importer: (filePath) => import(filePath.href),\n configureSuite: () => {},\n} satisfies Config\n\n/**\n * Config manager is used to hydrate the configuration by merging\n * the defaults, user defined config and the command line\n * flags.\n *\n * The command line flags have the upmost priority\n */\nexport class ConfigManager {\n #config: Config\n #cliArgs: CLIArgs\n\n constructor(config: Config, cliArgs: CLIArgs) {\n this.#config = config\n this.#cliArgs = cliArgs\n }\n\n /**\n * Processes a CLI argument and converts it to an\n * array of strings\n */\n #processAsArray(value: string | string[]): string[] {\n return Array.isArray(value) ? value : value.split(',').map((item: string) => item.trim())\n }\n\n /**\n * Returns a copy of filters based upon the CLI\n * arguments.\n */\n #getCLIFilters(): Filters {\n const filters: Filters = {}\n\n if (this.#cliArgs.tags) {\n filters.tags = this.#processAsArray(this.#cliArgs.tags)\n }\n if (this.#cliArgs.tests) {\n filters.tests = this.#processAsArray(this.#cliArgs.tests)\n }\n if (this.#cliArgs.files) {\n filters.files = this.#processAsArray(this.#cliArgs.files)\n }\n if (this.#cliArgs.groups) {\n filters.groups = this.#processAsArray(this.#cliArgs.groups)\n }\n if (this.#cliArgs._ && this.#cliArgs._.length) {\n filters.suites = this.#processAsArray(this.#cliArgs._)\n }\n\n return filters\n }\n\n /**\n * Returns the timeout from the CLI args\n */\n #getCLITimeout(): number | undefined {\n if (this.#cliArgs.timeout) {\n const value = Number(this.#cliArgs.timeout)\n if (!Number.isNaN(value)) {\n return value\n }\n }\n }\n\n /**\n * Returns the retries from the CLI args\n */\n #getCLIRetries(): number | undefined {\n if (this.#cliArgs.retries) {\n const value = Number(this.#cliArgs.retries)\n if (!Number.isNaN(value)) {\n return value\n }\n }\n }\n\n /**\n * Returns the forceExit property from the CLI args\n */\n #getCLIForceExit(): boolean | undefined {\n if (this.#cliArgs.forceExit) {\n return true\n }\n }\n\n /**\n * Returns reporters selected using the commandline\n * --reporter flag\n */\n #getCLIReporters(): string[] | undefined {\n if (this.#cliArgs.reporters) {\n return this.#processAsArray(this.#cliArgs.reporters)\n }\n }\n\n /**\n * Hydrates the config with user defined options and the\n * command-line flags.\n */\n hydrate(): NormalizedConfig {\n const cliFilters = this.#getCLIFilters()\n const cliRetries = this.#getCLIRetries()\n const cliTimeout = this.#getCLITimeout()\n const cliReporters = this.#getCLIReporters()\n const cliForceExit = this.#getCLIForceExit()\n\n debug('filters applied using CLI flags %O', cliFilters)\n\n const baseConfig: NormalizedBaseConfig = {\n cwd: this.#config.cwd ?? process.cwd(),\n filters: Object.assign({}, this.#config.filters ?? {}, cliFilters),\n importer: this.#config.importer ?? DEFAULTS.importer,\n refiner: this.#config.refiner ?? new Refiner(),\n retries: cliRetries ?? this.#config.retries ?? DEFAULTS.retries,\n timeout: cliTimeout ?? this.#config.timeout ?? DEFAULTS.timeout,\n plugins: this.#config.plugins ?? DEFAULTS.plugins,\n forceExit: cliForceExit ?? this.#config.forceExit ?? DEFAULTS.forceExit,\n reporters: this.#config.reporters\n ? {\n activated: this.#config.reporters.activated,\n list: this.#config.reporters.list || DEFAULTS.reporters.list,\n }\n : DEFAULTS.reporters,\n configureSuite: this.#config.configureSuite ?? DEFAULTS.configureSuite,\n setup: this.#config.setup || [],\n teardown: this.#config.teardown || [],\n }\n\n /**\n * Overwrite activated reporters when defined using CLI\n * flag\n */\n if (cliReporters) {\n baseConfig.reporters.activated = cliReporters\n }\n\n if ('files' in this.#config) {\n return {\n files: this.#config.files,\n ...baseConfig,\n }\n }\n\n return {\n suites: this.#config.suites.map((suite) => {\n return {\n name: suite.name,\n files: suite.files,\n timeout: cliTimeout ?? suite.timeout ?? baseConfig.timeout,\n retries: cliRetries ?? suite.retries ?? baseConfig.retries,\n configure: suite.configure || NOOP,\n }\n }),\n ...baseConfig,\n }\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { Emitter, Group, Refiner, Suite, Test, TestContext } from '../modules/core/main.js'\n\n/**\n * Function to create the test context for the test\n */\nconst contextBuilder = (testInstance: Test<any>) => new TestContext(testInstance)\n\n/**\n * Create a new instance of the Test\n */\nexport function createTest(\n title: string,\n emitter: Emitter,\n refiner: Refiner,\n options: {\n group?: Group\n suite?: Suite\n file?: string\n timeout?: number\n retries?: number\n }\n) {\n const testInstance = new Test<undefined>(title, contextBuilder, emitter, refiner, options.group)\n testInstance.options.meta.suite = options.suite\n testInstance.options.meta.group = options.group\n testInstance.options.meta.fileName = options.file\n\n if (options.timeout !== undefined) {\n testInstance.timeout(options.timeout)\n }\n if (options.retries !== undefined) {\n testInstance.retry(options.retries)\n }\n\n /**\n * Register test as a child either with the group or the suite\n */\n if (options.group) {\n options.group.add(testInstance)\n } else if (options.suite) {\n options.suite.add(testInstance)\n }\n\n return testInstance\n}\n\n/**\n * Create a new instance of the Group\n */\nexport function createTestGroup(\n title: string,\n emitter: Emitter,\n refiner: Refiner,\n options: {\n group?: Group\n suite?: Suite\n file?: string\n timeout?: number\n retries?: number\n }\n) {\n if (options.group) {\n throw new Error('Nested groups are not supported by Japa')\n }\n\n const group = new Group(title, emitter, refiner)\n group.options.meta.suite = options.suite\n group.options.meta.fileName = options.file\n\n if (options.suite) {\n options.suite.add(group)\n }\n\n return group\n}\n"],"mappings":";;;;;;;;;;;;;AASA,SAAS,gBAAgB;AACzB,IAAO,gBAAQ,SAAS,aAAa;;;ACKrC,IAAM,YAAN,MAAgB;AAAA;AAAA;AAAA;AAAA,EAId,mBAAmB,QAAsC;AACvD,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,wBAAwB,OAA0C;AAChE,QAAI,UAAU,YAAY;AACxB,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,qBAAqB,QAA0B;AAK7C,QAAI,CAAC,OAAO,QAAQ,UAAU,CAAC,OAAO,QAAQ,OAAO,QAAQ;AAC3D;AAAA,IACF;AAMA,QAAI,EAAE,YAAY,WAAW,CAAC,OAAO,OAAO,QAAQ;AAClD,YAAM,IAAI,MAAM,qEAAqE;AAAA,IACvF;A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B,IAAI,YAAY,YAAY;AAKzE,SAAS,WACd,OACA,SACA,SACA,SAOA;AACA,QAAM,eAAe,IAAI,KAAgB,OAAO,gBAAgB,SAAS,SAAS,QAAQ,KAAK;AAC/F,eAAa,QAAQ,KAAK,QAAQ,QAAQ;AAC1C,eAAa,QAAQ,KAAK,QAAQ,QAAQ;AAC1C,eAAa,QAAQ,KAAK,WAAW,QAAQ;AAE7C,MAAI,QAAQ,YAAY,QAAW;AACjC,iBAAa,QAAQ,QAAQ,OAAO;AAAA,EACtC;AACA,MAAI,QAAQ,YAAY,QAAW;AACjC,iBAAa,MAAM,QAAQ,OAAO;AAAA,EACpC;AAKA,MAAI,QAAQ,OAAO;AACjB,YAAQ,MAAM,IAAI,YAAY;AAAA,EAChC,WAAW,QAAQ,OAAO;AACxB,YAAQ,MAAM,IAAI,YAAY;AAAA,EAChC;AAEA,SAAO;AACT;AAKO,SAAS,gBACd,OACA,SACA,SACA,SAOA;AACA,MAAI,QAAQ,OAAO;AACjB,UAAM,IAAI,MAAM,yCAAyC;AAAA,EAC3D;AAEA,QAAM,QAAQ,IAAI,MAAM,OAAO,SAAS,OAAO;AAC/C,QAAM,QAAQ,KAAK,QAAQ,QAAQ;AACnC,QAAM,QAAQ,KAAK,WAAW,QAAQ;AAEtC,MAAI,QAAQ,OAAO;AACjB,YAAQ,MAAM,IAAI,KAAK;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
__reExport
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=chunk-MWYEWO7K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|