@rstest/core 0.8.5 → 0.9.1
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/LICENSE.md +2 -2
- package/dist/0~130.js +0 -1
- package/dist/0~1472.js +2 -2
- package/dist/0~2173.js +104 -74
- package/dist/{0~3919.js → 0~262.js} +31 -30
- package/dist/0~3062.js +1 -1
- package/dist/0~3346.js +1 -1
- package/dist/0~5835.js +17 -4
- package/dist/0~6923.js +11 -3
- package/dist/0~7583.js +2 -2
- package/dist/0~7882.js +37 -36
- package/dist/0~89.js +50 -31
- package/dist/0~9634.js +5 -5
- package/dist/0~9744.js +1014 -0
- package/dist/1294.js +1 -0
- package/dist/3160.js +14 -64
- package/dist/{5960.js → 4597.js} +0 -1
- package/dist/6151.js +3119 -51
- package/dist/9131.js +178 -100
- package/dist/browser-runtime/389.js +3398 -362
- package/dist/browser-runtime/index.d.ts +40 -10
- package/dist/browser.d.ts +53 -10
- package/dist/index.d.ts +44 -79
- package/dist/mockRuntimeCode.js +15 -9
- package/dist/worker.d.ts +13 -1521
- package/dist/worker.js +14 -8
- package/package.json +18 -15
- package/dist/0~1981.js +0 -2
- package/dist/0~9348.js +0 -951
- package/dist/721.js +0 -8
package/dist/1294.js
CHANGED
|
@@ -4906,6 +4906,7 @@ build_1["default"];
|
|
|
4906
4906
|
const REAL_TIMERS = {};
|
|
4907
4907
|
const setRealTimers = ()=>{
|
|
4908
4908
|
REAL_TIMERS.setTimeout ??= globalThis.setTimeout.bind(globalThis);
|
|
4909
|
+
REAL_TIMERS.clearTimeout ??= globalThis.clearTimeout.bind(globalThis);
|
|
4909
4910
|
};
|
|
4910
4911
|
const getRealTimers = ()=>REAL_TIMERS;
|
|
4911
4912
|
const formatTestError = (err, test)=>{
|
package/dist/3160.js
CHANGED
|
@@ -4,6 +4,7 @@ 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";
|
|
6
6
|
import * as __rspack_external_node_tty_c64aab7e from "node:tty";
|
|
7
|
+
import * as __rspack_external_node_util_1b29d436 from "node:util";
|
|
7
8
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
8
9
|
import node_process, { stdin, stdout } from "node:process";
|
|
9
10
|
__webpack_require__.add({
|
|
@@ -84,10 +85,22 @@ __webpack_require__.add({
|
|
|
84
85
|
},
|
|
85
86
|
"node:tty" (module) {
|
|
86
87
|
module.exports = __rspack_external_node_tty_c64aab7e;
|
|
88
|
+
},
|
|
89
|
+
"node:util" (module) {
|
|
90
|
+
module.exports = __rspack_external_node_util_1b29d436;
|
|
87
91
|
}
|
|
88
92
|
});
|
|
93
|
+
const external_node_util_ = __webpack_require__("node:util");
|
|
89
94
|
const external_node_os_ = __webpack_require__("node:os");
|
|
90
95
|
const external_node_tty_ = __webpack_require__("node:tty");
|
|
96
|
+
const createStyler = (style)=>(text)=>(0, external_node_util_.styleText)(style, String(text));
|
|
97
|
+
const bold = createStyler('bold');
|
|
98
|
+
const red = createStyler('red');
|
|
99
|
+
const green = createStyler('green');
|
|
100
|
+
const yellow = createStyler('yellow');
|
|
101
|
+
const magenta = createStyler('magenta');
|
|
102
|
+
const cyan = createStyler('cyan');
|
|
103
|
+
const gray = createStyler('gray');
|
|
91
104
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : node_process.argv) {
|
|
92
105
|
const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
|
|
93
106
|
const position = argv.indexOf(prefix + flag);
|
|
@@ -194,24 +207,6 @@ let errorStackRegExp = /at [^\r\n]{0,200}:\d+:\d+[\s\)]*$/;
|
|
|
194
207
|
let anonymousErrorStackRegExp = /at [^\r\n]{0,200}\(<anonymous>\)$/;
|
|
195
208
|
let indexErrorStackRegExp = /at [^\r\n]{0,200}\(index\s\d+\)$/;
|
|
196
209
|
let isErrorStackMessage = (message)=>errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message) || indexErrorStackRegExp.test(message);
|
|
197
|
-
let formatter = (open, close, replace = open)=>colorLevel >= 2 ? (input)=>{
|
|
198
|
-
let string = '' + input;
|
|
199
|
-
let index = string.indexOf(close, open.length);
|
|
200
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
201
|
-
} : String;
|
|
202
|
-
let replaceClose = (string, close, replace, index)=>{
|
|
203
|
-
let start = string.substring(0, index) + replace;
|
|
204
|
-
let end = string.substring(index + close.length);
|
|
205
|
-
let nextIndex = end.indexOf(close);
|
|
206
|
-
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
|
|
207
|
-
};
|
|
208
|
-
const bold = formatter('\x1b[1m', '\x1b[22m', '\x1b[22m\x1b[1m');
|
|
209
|
-
const red = formatter('\x1b[31m', '\x1b[39m');
|
|
210
|
-
const green = formatter('\x1b[32m', '\x1b[39m');
|
|
211
|
-
const yellow = formatter('\x1b[33m', '\x1b[39m');
|
|
212
|
-
const magenta = formatter('\x1b[35m', '\x1b[39m');
|
|
213
|
-
const cyan = formatter('\x1b[36m', '\x1b[39m');
|
|
214
|
-
const gray = formatter('\x1b[90m', '\x1b[39m');
|
|
215
210
|
let startColor = [
|
|
216
211
|
189,
|
|
217
212
|
255,
|
|
@@ -347,27 +342,6 @@ let createLogger = (options = {})=>{
|
|
|
347
342
|
return logger;
|
|
348
343
|
};
|
|
349
344
|
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
345
|
const CURSOR_CLI = 'cursor-cli';
|
|
372
346
|
const CLAUDE = 'claude';
|
|
373
347
|
const REPLIT = 'replit';
|
|
@@ -389,12 +363,6 @@ function determineAgent() {
|
|
|
389
363
|
}
|
|
390
364
|
};
|
|
391
365
|
}
|
|
392
|
-
if (process.env.CURSOR_TRACE_ID) return {
|
|
393
|
-
isAgent: true,
|
|
394
|
-
agent: {
|
|
395
|
-
name: CURSOR
|
|
396
|
-
}
|
|
397
|
-
};
|
|
398
366
|
if (process.env.CURSOR_AGENT) return {
|
|
399
367
|
isAgent: true,
|
|
400
368
|
agent: {
|
|
@@ -940,17 +908,6 @@ const getTaskNames = (test)=>(test.parentNames || []).concat(test.name).filter(B
|
|
|
940
908
|
const getTaskNameWithPrefix = (test, delimiter = ">")=>getTaskNames(test).join(delimiter ? ` ${delimiter} ` : ' ');
|
|
941
909
|
const REGEXP_FLAG_PREFIX = 'RSTEST_REGEXP:';
|
|
942
910
|
const wrapRegex = (value)=>`${REGEXP_FLAG_PREFIX}${value.toString()}`;
|
|
943
|
-
const unwrapRegex = (value)=>{
|
|
944
|
-
if (value.startsWith(REGEXP_FLAG_PREFIX)) {
|
|
945
|
-
const regexStr = value.slice(REGEXP_FLAG_PREFIX.length);
|
|
946
|
-
const matches = regexStr.match(/^\/(.+)\/([gimuy]*)$/);
|
|
947
|
-
if (matches) {
|
|
948
|
-
const [, pattern, flags] = matches;
|
|
949
|
-
return new RegExp(pattern, flags);
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
return value;
|
|
953
|
-
};
|
|
954
911
|
const serializableConfig = (normalizedConfig)=>{
|
|
955
912
|
const { testNamePattern } = normalizedConfig;
|
|
956
913
|
return {
|
|
@@ -958,13 +915,6 @@ const serializableConfig = (normalizedConfig)=>{
|
|
|
958
915
|
testNamePattern: testNamePattern && 'string' != typeof testNamePattern ? wrapRegex(testNamePattern) : testNamePattern
|
|
959
916
|
};
|
|
960
917
|
};
|
|
961
|
-
const undoSerializableConfig = (normalizedConfig)=>{
|
|
962
|
-
const { testNamePattern } = normalizedConfig;
|
|
963
|
-
return {
|
|
964
|
-
...normalizedConfig,
|
|
965
|
-
testNamePattern: testNamePattern && 'string' == typeof testNamePattern ? unwrapRegex(testNamePattern) : testNamePattern
|
|
966
|
-
};
|
|
967
|
-
};
|
|
968
918
|
const getNodeVersion = ()=>{
|
|
969
919
|
if ('string' == typeof process.versions?.node) {
|
|
970
920
|
const [major = 0, minor = 0, patch = 0] = process.versions.node.split('.').map(Number);
|
|
@@ -1044,4 +994,4 @@ const logger_logger = {
|
|
|
1044
994
|
console.error(message, ...args);
|
|
1045
995
|
}
|
|
1046
996
|
};
|
|
1047
|
-
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
|
|
997
|
+
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 };
|
package/dist/{5960.js → 4597.js}
RENAMED