@rstest/core 0.8.1 → 0.8.3
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/dist/0~130.js +1 -2
- package/dist/0~1472.js +2 -3
- package/dist/0~1981.js +1 -2
- package/dist/0~2173.js +65 -27
- package/dist/0~2255.js +1 -2
- package/dist/0~3062.js +1 -2
- package/dist/0~3346.js +1 -2
- package/dist/0~3919.js +1 -2
- package/dist/0~4403.js +4 -4
- package/dist/0~4809.js +1 -2
- package/dist/0~5835.js +1 -2
- package/dist/0~62.js +1 -2
- package/dist/0~6588.js +4 -4
- package/dist/0~6907.js +1 -2
- package/dist/0~6923.js +1 -2
- package/dist/0~7583.js +1 -2
- package/dist/0~7882.js +7 -579
- package/dist/0~8426.js +1 -2
- package/dist/0~89.js +16 -12
- package/dist/0~9348.js +1 -2
- package/dist/0~9634.js +21 -8
- package/dist/1157.js +48 -97
- package/dist/1294.js +1 -2
- package/dist/1672.js +1 -2
- package/dist/3160.js +111 -8
- package/dist/3216.js +1 -2
- package/dist/4397.js +1 -2
- package/dist/4484.js +1 -2
- package/dist/487.js +1 -2
- package/dist/4881.js +1 -2
- package/dist/4899.js +2 -2
- package/dist/5734.js +1 -2
- package/dist/6151.js +13 -10
- package/dist/6198.js +1 -2
- package/dist/6973.js +1 -2
- package/dist/7011.js +1 -2
- package/dist/721.js +1 -2
- package/dist/9131.js +1329 -27
- package/dist/browser-runtime/2~907.js +0 -2
- package/dist/browser-runtime/389.js +14 -11
- package/dist/browser-runtime/389.js.LICENSE.txt +22 -0
- package/dist/browser-runtime/index.d.ts +100 -111
- package/dist/browser-runtime/rslib-runtime.js +0 -2
- package/dist/browser.d.ts +156 -110
- package/dist/browser.js +2 -2
- package/dist/globalSetupWorker.js +1 -2
- package/dist/index.d.ts +100 -110
- package/dist/index.js +1 -2
- package/dist/mockRuntimeCode.js +63 -174
- package/dist/rslib-runtime.js +1 -2
- package/dist/worker.d.ts +99 -110
- package/dist/worker.js +1 -2
- package/package.json +4 -4
- package/dist/browser-runtime/2~907.js.map +0 -1
- package/dist/browser-runtime/389.js.map +0 -1
- package/dist/browser-runtime/rslib-runtime.js.map +0 -1
- /package/dist/{1157.js.LICENSE.txt → 3160.js.LICENSE.txt} +0 -0
package/dist/0~9634.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
/*#__PURE__*/ import.meta.url;
|
|
1
|
+
import "node:module";
|
|
3
2
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
3
|
import { logger as logger_logger, getTaskNameWithPrefix, color, bgColor } from "./3160.js";
|
|
5
4
|
import { prepareRsbuild, createPool, createRsbuildServer, runGlobalTeardown, runGlobalSetup } from "./0~89.js";
|
|
6
|
-
import { getTestEntries, prettyTestPath, ROOT_SUITE_NAME } from "./1157.js";
|
|
5
|
+
import { getTestEntries, resolveShardedEntries, prettyTestPath, ROOT_SUITE_NAME } from "./1157.js";
|
|
7
6
|
const external_node_fs_ = __webpack_require__("node:fs");
|
|
8
7
|
const external_node_path_ = __webpack_require__("node:path");
|
|
9
8
|
const collectNodeTests = async ({ context, nodeProjects, globTestSourceEntries })=>{
|
|
@@ -99,7 +98,7 @@ const collectNodeTests = async ({ context, nodeProjects, globTestSourceEntries }
|
|
|
99
98
|
}
|
|
100
99
|
};
|
|
101
100
|
};
|
|
102
|
-
const collectBrowserTests = async ({ context, browserProjects })=>{
|
|
101
|
+
const collectBrowserTests = async ({ context, browserProjects, shardedEntries })=>{
|
|
103
102
|
if (0 === browserProjects.length) return {
|
|
104
103
|
list: [],
|
|
105
104
|
close: async ()=>{}
|
|
@@ -111,7 +110,9 @@ const collectBrowserTests = async ({ context, browserProjects })=>{
|
|
|
111
110
|
const { listBrowserTests } = await loadBrowserModule({
|
|
112
111
|
projectRoots
|
|
113
112
|
});
|
|
114
|
-
return listBrowserTests(context
|
|
113
|
+
return listBrowserTests(context, {
|
|
114
|
+
shardedEntries
|
|
115
|
+
});
|
|
115
116
|
};
|
|
116
117
|
const collectTestFiles = async ({ context, globTestSourceEntries })=>{
|
|
117
118
|
const list = [];
|
|
@@ -130,7 +131,7 @@ const collectTestFiles = async ({ context, globTestSourceEntries })=>{
|
|
|
130
131
|
getSourceMap: async (_name)=>null
|
|
131
132
|
};
|
|
132
133
|
};
|
|
133
|
-
const collectAllTests = async ({ context, globTestSourceEntries })=>{
|
|
134
|
+
const collectAllTests = async ({ context, globTestSourceEntries, shardedEntries })=>{
|
|
134
135
|
const browserProjects = context.projects.filter((p)=>p.normalizedConfig.browser.enabled);
|
|
135
136
|
const nodeProjects = context.projects.filter((p)=>!p.normalizedConfig.browser.enabled);
|
|
136
137
|
const [nodeResult, browserResult] = await Promise.all([
|
|
@@ -141,7 +142,8 @@ const collectAllTests = async ({ context, globTestSourceEntries })=>{
|
|
|
141
142
|
}),
|
|
142
143
|
collectBrowserTests({
|
|
143
144
|
context,
|
|
144
|
-
browserProjects
|
|
145
|
+
browserProjects,
|
|
146
|
+
shardedEntries
|
|
145
147
|
})
|
|
146
148
|
]);
|
|
147
149
|
return {
|
|
@@ -161,7 +163,17 @@ const collectAllTests = async ({ context, globTestSourceEntries })=>{
|
|
|
161
163
|
};
|
|
162
164
|
async function listTests(context, { filesOnly, json, printLocation, includeSuites }) {
|
|
163
165
|
const { rootPath } = context;
|
|
166
|
+
const { shard } = context.normalizedConfig;
|
|
167
|
+
const shardedEntries = await resolveShardedEntries(context);
|
|
164
168
|
const testEntries = {};
|
|
169
|
+
let shardedBrowserEntries;
|
|
170
|
+
if (shard && shardedEntries) {
|
|
171
|
+
for (const [key, value] of shardedEntries.entries())testEntries[key] = value.entries;
|
|
172
|
+
shardedBrowserEntries = new Map();
|
|
173
|
+
for (const p of context.projects.filter((p)=>p.normalizedConfig.browser.enabled))shardedBrowserEntries.set(p.environmentName, {
|
|
174
|
+
entries: testEntries[p.environmentName] || {}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
165
177
|
const globTestSourceEntries = async (name)=>{
|
|
166
178
|
if (testEntries[name]) return testEntries[name];
|
|
167
179
|
const { include, exclude, includeSource, root } = context.projects.find((p)=>p.environmentName === name).normalizedConfig;
|
|
@@ -181,7 +193,8 @@ async function listTests(context, { filesOnly, json, printLocation, includeSuite
|
|
|
181
193
|
globTestSourceEntries
|
|
182
194
|
}) : await collectAllTests({
|
|
183
195
|
context,
|
|
184
|
-
globTestSourceEntries
|
|
196
|
+
globTestSourceEntries,
|
|
197
|
+
shardedEntries: shardedBrowserEntries
|
|
185
198
|
});
|
|
186
199
|
const tests = [];
|
|
187
200
|
const traverseTests = (test)=>{
|
package/dist/1157.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import 'module';
|
|
3
|
-
/*#__PURE__*/ import.meta.url;
|
|
1
|
+
import "node:module";
|
|
4
2
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
5
|
-
import promises, { lstat, readdir, realpath, stat as promises_stat
|
|
3
|
+
import promises, { lstat, readdir, realpath, stat as promises_stat } from "node:fs/promises";
|
|
6
4
|
import { fileURLToPath } from "url";
|
|
7
5
|
import { createRequire } from "module";
|
|
8
|
-
import { color, castArray
|
|
6
|
+
import { logger as logger_logger, parsePosix, color, castArray } from "./3160.js";
|
|
9
7
|
import { posix } from "./7011.js";
|
|
10
8
|
__webpack_require__.add({
|
|
11
9
|
"../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
@@ -1415,97 +1413,6 @@ __webpack_require__.add({
|
|
|
1415
1413
|
};
|
|
1416
1414
|
}
|
|
1417
1415
|
});
|
|
1418
|
-
/*!
|
|
1419
|
-
* Copyright 2017 Vercel, Inc.
|
|
1420
|
-
*
|
|
1421
|
-
* This file is derived from Vercel's detect-agent:
|
|
1422
|
-
* https://github.com/vercel/vercel/tree/main/packages/detect-agent
|
|
1423
|
-
*
|
|
1424
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1425
|
-
* you may not use this file except in compliance with the License.
|
|
1426
|
-
* You may obtain a copy of the License at
|
|
1427
|
-
*
|
|
1428
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1429
|
-
*
|
|
1430
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1431
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1432
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1433
|
-
* See the License for the specific language governing permissions and
|
|
1434
|
-
* limitations under the License.
|
|
1435
|
-
*
|
|
1436
|
-
* Modifications in this derived work:
|
|
1437
|
-
* - Removed async determine logic, kept only env detection.
|
|
1438
|
-
*/ const CURSOR = 'cursor';
|
|
1439
|
-
const CURSOR_CLI = 'cursor-cli';
|
|
1440
|
-
const CLAUDE = 'claude';
|
|
1441
|
-
const REPLIT = 'replit';
|
|
1442
|
-
const GEMINI = 'gemini';
|
|
1443
|
-
const CODEX = 'codex';
|
|
1444
|
-
const AUGMENT_CLI = 'augment-cli';
|
|
1445
|
-
const OPENCODE = 'opencode';
|
|
1446
|
-
function determineAgent() {
|
|
1447
|
-
if (process.env.AI_AGENT) {
|
|
1448
|
-
const name = process.env.AI_AGENT.trim();
|
|
1449
|
-
if (name) return {
|
|
1450
|
-
isAgent: true,
|
|
1451
|
-
agent: {
|
|
1452
|
-
name: name
|
|
1453
|
-
}
|
|
1454
|
-
};
|
|
1455
|
-
}
|
|
1456
|
-
if (process.env.CURSOR_TRACE_ID) return {
|
|
1457
|
-
isAgent: true,
|
|
1458
|
-
agent: {
|
|
1459
|
-
name: CURSOR
|
|
1460
|
-
}
|
|
1461
|
-
};
|
|
1462
|
-
if (process.env.CURSOR_AGENT) return {
|
|
1463
|
-
isAgent: true,
|
|
1464
|
-
agent: {
|
|
1465
|
-
name: CURSOR_CLI
|
|
1466
|
-
}
|
|
1467
|
-
};
|
|
1468
|
-
if (process.env.GEMINI_CLI) return {
|
|
1469
|
-
isAgent: true,
|
|
1470
|
-
agent: {
|
|
1471
|
-
name: GEMINI
|
|
1472
|
-
}
|
|
1473
|
-
};
|
|
1474
|
-
if (process.env.CODEX_SANDBOX) return {
|
|
1475
|
-
isAgent: true,
|
|
1476
|
-
agent: {
|
|
1477
|
-
name: CODEX
|
|
1478
|
-
}
|
|
1479
|
-
};
|
|
1480
|
-
if (process.env.AUGMENT_AGENT) return {
|
|
1481
|
-
isAgent: true,
|
|
1482
|
-
agent: {
|
|
1483
|
-
name: AUGMENT_CLI
|
|
1484
|
-
}
|
|
1485
|
-
};
|
|
1486
|
-
if (process.env.OPENCODE) return {
|
|
1487
|
-
isAgent: true,
|
|
1488
|
-
agent: {
|
|
1489
|
-
name: OPENCODE
|
|
1490
|
-
}
|
|
1491
|
-
};
|
|
1492
|
-
if (process.env.CLAUDECODE || process.env.CLAUDE_CODE) return {
|
|
1493
|
-
isAgent: true,
|
|
1494
|
-
agent: {
|
|
1495
|
-
name: CLAUDE
|
|
1496
|
-
}
|
|
1497
|
-
};
|
|
1498
|
-
if (process.env.REPL_ID) return {
|
|
1499
|
-
isAgent: true,
|
|
1500
|
-
agent: {
|
|
1501
|
-
name: REPLIT
|
|
1502
|
-
}
|
|
1503
|
-
};
|
|
1504
|
-
return {
|
|
1505
|
-
isAgent: false,
|
|
1506
|
-
agent: void 0
|
|
1507
|
-
};
|
|
1508
|
-
}
|
|
1509
1416
|
const DEFAULT_CONFIG_NAME = 'rstest.config';
|
|
1510
1417
|
const ROOT_SUITE_NAME = 'Rstest:_internal_root_suite';
|
|
1511
1418
|
const TEMP_RSTEST_OUTPUT_DIR = 'dist/.rstest-temp';
|
|
@@ -2366,4 +2273,48 @@ const formatTestPath = (root, testFilePath)=>{
|
|
|
2366
2273
|
if (posix.isAbsolute(testPath) && testPath.includes(root)) testPath = posix.relative(root, testPath);
|
|
2367
2274
|
return prettyTestPath(testPath);
|
|
2368
2275
|
};
|
|
2369
|
-
|
|
2276
|
+
function getShardedFiles(files, shard) {
|
|
2277
|
+
const { count, index } = shard;
|
|
2278
|
+
if (count <= 1) return files;
|
|
2279
|
+
const size = Math.ceil(files.length / count);
|
|
2280
|
+
const start = (index - 1) * size;
|
|
2281
|
+
const end = start + size;
|
|
2282
|
+
return files.sort((a, b)=>a.testPath.localeCompare(b.testPath)).slice(start, end);
|
|
2283
|
+
}
|
|
2284
|
+
async function resolveShardedEntries(context) {
|
|
2285
|
+
const { normalizedConfig, projects: allProjects, rootPath, fileFilters } = context;
|
|
2286
|
+
const { shard } = normalizedConfig;
|
|
2287
|
+
if (!shard) return;
|
|
2288
|
+
const allTestEntriesBeforeSharding = (await Promise.all(allProjects.map(async (p)=>{
|
|
2289
|
+
const { include, exclude, includeSource, root } = p.normalizedConfig;
|
|
2290
|
+
const entries = await getTestEntries({
|
|
2291
|
+
include,
|
|
2292
|
+
exclude: exclude.patterns,
|
|
2293
|
+
includeSource,
|
|
2294
|
+
rootPath,
|
|
2295
|
+
projectRoot: root,
|
|
2296
|
+
fileFilters: fileFilters || []
|
|
2297
|
+
});
|
|
2298
|
+
return Object.entries(entries).map(([alias, testPath])=>({
|
|
2299
|
+
project: p.environmentName,
|
|
2300
|
+
alias,
|
|
2301
|
+
testPath
|
|
2302
|
+
}));
|
|
2303
|
+
}))).flat();
|
|
2304
|
+
const shardedEntries = getShardedFiles(allTestEntriesBeforeSharding, shard);
|
|
2305
|
+
const totalTestFileCount = allTestEntriesBeforeSharding.length;
|
|
2306
|
+
const testFilesInShardCount = shardedEntries.length;
|
|
2307
|
+
logger_logger.log(color.green(`Running shard ${shard.index} of ${shard.count} (${testFilesInShardCount} of ${totalTestFileCount} test files)\n`));
|
|
2308
|
+
const shardedEntriesByProject = new Map();
|
|
2309
|
+
for (const { project, alias, testPath } of shardedEntries){
|
|
2310
|
+
if (!shardedEntriesByProject.has(project)) shardedEntriesByProject.set(project, {});
|
|
2311
|
+
shardedEntriesByProject.get(project)[alias] = testPath;
|
|
2312
|
+
}
|
|
2313
|
+
const entriesCache = new Map();
|
|
2314
|
+
for (const p of allProjects)entriesCache.set(p.environmentName, {
|
|
2315
|
+
entries: shardedEntriesByProject.get(p.environmentName) || {},
|
|
2316
|
+
fileFilters: fileFilters
|
|
2317
|
+
});
|
|
2318
|
+
return entriesCache;
|
|
2319
|
+
}
|
|
2320
|
+
export { DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME, ROOT_SUITE_NAME, TEMP_RSTEST_OUTPUT_DIR, TEMP_RSTEST_OUTPUT_DIR_GLOB, TS_CONFIG_FILE, filterProjects, formatTestEntryName, formatTestPath, getTestEntries, glob, globalApis, isDynamicPattern, lstat, prettyTestPath, promises, promises_stat, readdir, realpath, resolveShardedEntries };
|
package/dist/1294.js
CHANGED
package/dist/1672.js
CHANGED
package/dist/3160.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*! For license information please see 3160.js.LICENSE.txt */
|
|
2
|
+
import "node:module";
|
|
3
3
|
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
4
4
|
import * as __rspack_external_node_os_74b4b876 from "node:os";
|
|
5
5
|
import * as __rspack_external_node_path_c5b9b54f from "node:path";
|
|
@@ -347,6 +347,101 @@ let createLogger = (options = {})=>{
|
|
|
347
347
|
return logger;
|
|
348
348
|
};
|
|
349
349
|
let src_logger = createLogger();
|
|
350
|
+
/*!
|
|
351
|
+
* Copyright 2017 Vercel, Inc.
|
|
352
|
+
*
|
|
353
|
+
* This file is derived from Vercel's detect-agent:
|
|
354
|
+
* https://github.com/vercel/vercel/tree/main/packages/detect-agent
|
|
355
|
+
*
|
|
356
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
357
|
+
* you may not use this file except in compliance with the License.
|
|
358
|
+
* You may obtain a copy of the License at
|
|
359
|
+
*
|
|
360
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
361
|
+
*
|
|
362
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
363
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
364
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
365
|
+
* See the License for the specific language governing permissions and
|
|
366
|
+
* limitations under the License.
|
|
367
|
+
*
|
|
368
|
+
* Modifications in this derived work:
|
|
369
|
+
* - Removed async determine logic, kept only env detection.
|
|
370
|
+
*/ const CURSOR = 'cursor';
|
|
371
|
+
const CURSOR_CLI = 'cursor-cli';
|
|
372
|
+
const CLAUDE = 'claude';
|
|
373
|
+
const REPLIT = 'replit';
|
|
374
|
+
const GEMINI = 'gemini';
|
|
375
|
+
const CODEX = 'codex';
|
|
376
|
+
const AUGMENT_CLI = 'augment-cli';
|
|
377
|
+
const OPENCODE = 'opencode';
|
|
378
|
+
function determineAgent() {
|
|
379
|
+
if ('1' === process.env.RSTEST_NO_AGENT) return {
|
|
380
|
+
isAgent: false,
|
|
381
|
+
agent: void 0
|
|
382
|
+
};
|
|
383
|
+
if (process.env.AI_AGENT) {
|
|
384
|
+
const name = process.env.AI_AGENT.trim();
|
|
385
|
+
if (name) return {
|
|
386
|
+
isAgent: true,
|
|
387
|
+
agent: {
|
|
388
|
+
name: name
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
if (process.env.CURSOR_TRACE_ID) return {
|
|
393
|
+
isAgent: true,
|
|
394
|
+
agent: {
|
|
395
|
+
name: CURSOR
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
if (process.env.CURSOR_AGENT) return {
|
|
399
|
+
isAgent: true,
|
|
400
|
+
agent: {
|
|
401
|
+
name: CURSOR_CLI
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
if (process.env.GEMINI_CLI) return {
|
|
405
|
+
isAgent: true,
|
|
406
|
+
agent: {
|
|
407
|
+
name: GEMINI
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
if (process.env.CODEX_SANDBOX) return {
|
|
411
|
+
isAgent: true,
|
|
412
|
+
agent: {
|
|
413
|
+
name: CODEX
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
if (process.env.AUGMENT_AGENT) return {
|
|
417
|
+
isAgent: true,
|
|
418
|
+
agent: {
|
|
419
|
+
name: AUGMENT_CLI
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
if (process.env.OPENCODE) return {
|
|
423
|
+
isAgent: true,
|
|
424
|
+
agent: {
|
|
425
|
+
name: OPENCODE
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
if (process.env.CLAUDECODE || process.env.CLAUDE_CODE) return {
|
|
429
|
+
isAgent: true,
|
|
430
|
+
agent: {
|
|
431
|
+
name: CLAUDE
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
if (process.env.REPL_ID) return {
|
|
435
|
+
isAgent: true,
|
|
436
|
+
agent: {
|
|
437
|
+
name: REPLIT
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
return {
|
|
441
|
+
isAgent: false,
|
|
442
|
+
agent: void 0
|
|
443
|
+
};
|
|
444
|
+
}
|
|
350
445
|
let _lazyMatch = ()=>{
|
|
351
446
|
var __lib__ = (()=>{
|
|
352
447
|
var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e)=>{
|
|
@@ -842,7 +937,7 @@ const prettyTime = (milliseconds)=>{
|
|
|
842
937
|
return time;
|
|
843
938
|
};
|
|
844
939
|
const getTaskNames = (test)=>(test.parentNames || []).concat(test.name).filter(Boolean);
|
|
845
|
-
const getTaskNameWithPrefix = (test, delimiter = ">")=>getTaskNames(test).join(` ${delimiter} `);
|
|
940
|
+
const getTaskNameWithPrefix = (test, delimiter = ">")=>getTaskNames(test).join(delimiter ? ` ${delimiter} ` : ' ');
|
|
846
941
|
const REGEXP_FLAG_PREFIX = 'RSTEST_REGEXP:';
|
|
847
942
|
const wrapRegex = (value)=>`${REGEXP_FLAG_PREFIX}${value.toString()}`;
|
|
848
943
|
const unwrapRegex = (value)=>{
|
|
@@ -915,12 +1010,20 @@ const isDebug = ()=>{
|
|
|
915
1010
|
'*'
|
|
916
1011
|
].some((key)=>values.includes(key));
|
|
917
1012
|
};
|
|
918
|
-
const ansiEnabled = picocolors.isColorSupported;
|
|
919
1013
|
const getForceColorEnv = ()=>{
|
|
920
|
-
|
|
921
|
-
|
|
1014
|
+
if (void 0 !== process.env.FORCE_COLOR) return {};
|
|
1015
|
+
const noColorEnabled = '1' === process.env.NO_COLOR;
|
|
1016
|
+
const isAgent = determineAgent().isAgent;
|
|
1017
|
+
if (noColorEnabled) return {
|
|
1018
|
+
FORCE_COLOR: '0'
|
|
1019
|
+
};
|
|
1020
|
+
if (isAgent || !picocolors.isColorSupported) return {
|
|
1021
|
+
NO_COLOR: '1',
|
|
1022
|
+
FORCE_COLOR: '0'
|
|
1023
|
+
};
|
|
1024
|
+
return {
|
|
922
1025
|
FORCE_COLOR: '1'
|
|
923
|
-
}
|
|
1026
|
+
};
|
|
924
1027
|
};
|
|
925
1028
|
const color = (0, picocolors.createColors)();
|
|
926
1029
|
if (isDebug()) src_logger.level = 'verbose';
|
|
@@ -948,4 +1051,4 @@ const logger_logger = {
|
|
|
948
1051
|
console.error(message, ...args);
|
|
949
1052
|
}
|
|
950
1053
|
};
|
|
951
|
-
export { ADDITIONAL_NODE_BUILTINS, _path,
|
|
1054
|
+
export { ADDITIONAL_NODE_BUILTINS, _path, basename, bgColor, castArray, clearScreen, color, determineAgent, dirname, formatError, formatRootStr, getAbsolutePath, getForceColorEnv, getTaskNameWithPrefix, isAbsolute, isDebug, isDeno, isObject, isTTY, join, logger_logger as logger, needFlagExperimentalDetectModule, node_process, normalize, parsePosix, prettyTime, relative, resolve, serializableConfig, stdin, stdout, undoSerializableConfig };
|
package/dist/3216.js
CHANGED
package/dist/4397.js
CHANGED
package/dist/4484.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
/*#__PURE__*/ import.meta.url;
|
|
1
|
+
import "node:module";
|
|
3
2
|
import * as __rspack_external__rsbuild_core_1b356efc from "@rsbuild/core";
|
|
4
3
|
const check = (name)=>{
|
|
5
4
|
if (!globalThis.RSTEST_API?.[name]) throw new Error(`Rstest API '${name}' is not registered yet, please make sure you are running in a rstest environment.`);
|
package/dist/487.js
CHANGED
package/dist/4881.js
CHANGED
package/dist/4899.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __rslib_shim_module__ from
|
|
2
|
-
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(import.meta.url);
|
|
1
|
+
import __rslib_shim_module__ from "node:module";
|
|
2
|
+
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(/*#__PURE__*/ (()=>import.meta.url)());
|
|
3
3
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
4
|
__webpack_require__.add({
|
|
5
5
|
timers (module) {
|
package/dist/5734.js
CHANGED
package/dist/6151.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/*! For license information please see 6151.js.LICENSE.txt */
|
|
2
|
-
import
|
|
3
|
-
/*#__PURE__*/ import.meta.url;
|
|
2
|
+
import "node:module";
|
|
4
3
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
5
4
|
import { getTaskNameWithPrefix, isObject as helper_isObject, castArray, resolve as pathe_M_eThtNZ_resolve, normalize } from "./3160.js";
|
|
6
5
|
import { getRealTimers, TestRegisterError, formatTestError, formatName } from "./1294.js";
|
|
@@ -12047,7 +12046,8 @@ function hasOnlyTest(test) {
|
|
|
12047
12046
|
}
|
|
12048
12047
|
const shouldTestSkip = (test, runOnly, testNamePattern)=>{
|
|
12049
12048
|
if (runOnly && 'only' !== test.runMode) return true;
|
|
12050
|
-
|
|
12049
|
+
const delimiter = testNamePattern?.toString().includes(">") ? ">" : '';
|
|
12050
|
+
if (testNamePattern && !getTaskNameWithPrefix(test, delimiter).match(testNamePattern)) return true;
|
|
12051
12051
|
return false;
|
|
12052
12052
|
};
|
|
12053
12053
|
const traverseUpdateTestRunMode = (testSuite, parentRunMode, runOnly, testNamePattern)=>{
|
|
@@ -12288,13 +12288,16 @@ class TestRunner {
|
|
|
12288
12288
|
result.errors ??= [];
|
|
12289
12289
|
result.errors.push(...formatTestError(error));
|
|
12290
12290
|
}
|
|
12291
|
-
if ('fail' === result.status)
|
|
12292
|
-
|
|
12293
|
-
|
|
12294
|
-
|
|
12295
|
-
|
|
12296
|
-
|
|
12297
|
-
|
|
12291
|
+
if ('fail' === result.status) {
|
|
12292
|
+
for (const fn of [
|
|
12293
|
+
...test.onFailed
|
|
12294
|
+
].reverse())try {
|
|
12295
|
+
await fn(test.context);
|
|
12296
|
+
} catch (error) {
|
|
12297
|
+
result.errors ??= [];
|
|
12298
|
+
result.errors.push(...formatTestError(error));
|
|
12299
|
+
}
|
|
12300
|
+
snapshotClient.skipTest(testPath, getTaskNameWithPrefix(test));
|
|
12298
12301
|
}
|
|
12299
12302
|
this.resetCurrentTest();
|
|
12300
12303
|
return result;
|
package/dist/6198.js
CHANGED
package/dist/6973.js
CHANGED
package/dist/7011.js
CHANGED
package/dist/721.js
CHANGED