@rstest/core 0.6.0 → 0.6.2
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 +0 -14
- package/dist/0~171.js +4 -6
- package/dist/0~204.js +67 -77
- package/dist/0~263.js +1423 -0
- package/dist/0~350.js +30 -373
- package/dist/0~365.js +92 -0
- package/dist/0~463.js +331 -0
- package/dist/0~470.js +382 -0
- package/dist/0~535.js +10 -0
- package/dist/0~607.js +119 -0
- package/dist/0~610.js +10 -0
- package/dist/0~673.js +10 -0
- package/dist/0~691.js +74 -82
- package/dist/0~711.js +30 -373
- package/dist/0~763.js +10 -0
- package/dist/0~764.js +13284 -0
- package/dist/0~814.js +900 -0
- package/dist/0~830.js +1130 -0
- package/dist/0~836.js +13 -21
- package/dist/0~971.js +130 -136
- package/dist/597.js +174 -0
- package/dist/603.js +41 -0
- package/dist/808.js +167 -0
- package/dist/857.js +3252 -0
- package/dist/index.js +2394 -5971
- package/dist/mockRuntimeCode.js +11 -4
- package/dist/runtime.js +60 -0
- package/dist/worker.js +155 -1389
- package/dist-types/index.d.ts +25 -3
- package/dist-types/worker.d.ts +9 -2
- package/package.json +3 -3
- package/dist/0~33.js +0 -425
- package/dist/0~414.js +0 -16
- package/dist/0~493.js +0 -126
- package/dist/0~603.js +0 -50
- package/dist/0~628.js +0 -1089
- package/dist/0~655.js +0 -11533
- package/dist/0~85.js +0 -1819
- package/dist/0~873.js +0 -1220
- package/dist/0~928.js +0 -1432
- package/dist/0~967.js +0 -99
- /package/dist/{0~928.js.LICENSE.txt → 0~263.js.LICENSE.txt} +0 -0
- /package/dist/{0~655.js.LICENSE.txt → 0~764.js.LICENSE.txt} +0 -0
package/dist/worker.js
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
/*! For license information please see worker.js.LICENSE.txt */
|
|
2
2
|
import __rslib_shim_module__ from 'module';
|
|
3
3
|
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(import.meta.url);
|
|
4
|
-
import
|
|
5
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_promises_153e37e0__ from "node:fs/promises";
|
|
6
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
|
|
7
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__ from "node:os";
|
|
8
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
9
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__ from "node:process";
|
|
10
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_tty_c64aab7e__ from "node:tty";
|
|
11
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__ from "node:util";
|
|
12
|
-
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { __webpack_require__ } from "./runtime.js";
|
|
13
5
|
import node_vm from "node:vm";
|
|
14
|
-
import
|
|
15
|
-
|
|
6
|
+
import { basename, globalApis, posix, external_node_module_createRequire, dirname, resolve as pathe_M_eThtNZ_resolve, undoSerializableConfig, src_logger, isAbsolute, join } from "./857.js";
|
|
7
|
+
import { node_v8, pathToFileURL, createBirpc } from "./808.js";
|
|
8
|
+
import { createCoverageProvider } from "./603.js";
|
|
9
|
+
__webpack_require__.add({
|
|
16
10
|
"../../node_modules/.pnpm/@jest+diff-sequences@30.0.1/node_modules/@jest/diff-sequences/build/index.js": function(module) {
|
|
17
11
|
/*!
|
|
18
12
|
* /**
|
|
@@ -626,7 +620,8 @@ var __webpack_modules__ = {
|
|
|
626
620
|
get: assembleStyles
|
|
627
621
|
});
|
|
628
622
|
},
|
|
629
|
-
"../../node_modules/.pnpm/ansi-styles@5.2.0/node_modules/ansi-styles/index.js": function(module,
|
|
623
|
+
"../../node_modules/.pnpm/ansi-styles@5.2.0/node_modules/ansi-styles/index.js": function(module, exports, __webpack_require__) {
|
|
624
|
+
__webpack_require__.r(exports);
|
|
630
625
|
module = __webpack_require__.nmd(module);
|
|
631
626
|
const ANSI_BACKGROUND_OFFSET = 10;
|
|
632
627
|
const wrapAnsi256 = (offset = 0)=>(code)=>`\u001B[${38 + offset};5;${code}m`;
|
|
@@ -3888,72 +3883,6 @@ var __webpack_modules__ = {
|
|
|
3888
3883
|
module.exports = __nested_webpack_exports__;
|
|
3889
3884
|
})();
|
|
3890
3885
|
},
|
|
3891
|
-
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js": function(module) {
|
|
3892
|
-
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
3893
|
-
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
3894
|
-
let formatter = (open, close, replace = open)=>(input)=>{
|
|
3895
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
3896
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
3897
|
-
};
|
|
3898
|
-
let replaceClose = (string, close, replace, index)=>{
|
|
3899
|
-
let result = "", cursor = 0;
|
|
3900
|
-
do {
|
|
3901
|
-
result += string.substring(cursor, index) + replace;
|
|
3902
|
-
cursor = index + close.length;
|
|
3903
|
-
index = string.indexOf(close, cursor);
|
|
3904
|
-
}while (~index);
|
|
3905
|
-
return result + string.substring(cursor);
|
|
3906
|
-
};
|
|
3907
|
-
let createColors = (enabled = isColorSupported)=>{
|
|
3908
|
-
let f = enabled ? formatter : ()=>String;
|
|
3909
|
-
return {
|
|
3910
|
-
isColorSupported: enabled,
|
|
3911
|
-
reset: f("\x1b[0m", "\x1b[0m"),
|
|
3912
|
-
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
3913
|
-
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
3914
|
-
italic: f("\x1b[3m", "\x1b[23m"),
|
|
3915
|
-
underline: f("\x1b[4m", "\x1b[24m"),
|
|
3916
|
-
inverse: f("\x1b[7m", "\x1b[27m"),
|
|
3917
|
-
hidden: f("\x1b[8m", "\x1b[28m"),
|
|
3918
|
-
strikethrough: f("\x1b[9m", "\x1b[29m"),
|
|
3919
|
-
black: f("\x1b[30m", "\x1b[39m"),
|
|
3920
|
-
red: f("\x1b[31m", "\x1b[39m"),
|
|
3921
|
-
green: f("\x1b[32m", "\x1b[39m"),
|
|
3922
|
-
yellow: f("\x1b[33m", "\x1b[39m"),
|
|
3923
|
-
blue: f("\x1b[34m", "\x1b[39m"),
|
|
3924
|
-
magenta: f("\x1b[35m", "\x1b[39m"),
|
|
3925
|
-
cyan: f("\x1b[36m", "\x1b[39m"),
|
|
3926
|
-
white: f("\x1b[37m", "\x1b[39m"),
|
|
3927
|
-
gray: f("\x1b[90m", "\x1b[39m"),
|
|
3928
|
-
bgBlack: f("\x1b[40m", "\x1b[49m"),
|
|
3929
|
-
bgRed: f("\x1b[41m", "\x1b[49m"),
|
|
3930
|
-
bgGreen: f("\x1b[42m", "\x1b[49m"),
|
|
3931
|
-
bgYellow: f("\x1b[43m", "\x1b[49m"),
|
|
3932
|
-
bgBlue: f("\x1b[44m", "\x1b[49m"),
|
|
3933
|
-
bgMagenta: f("\x1b[45m", "\x1b[49m"),
|
|
3934
|
-
bgCyan: f("\x1b[46m", "\x1b[49m"),
|
|
3935
|
-
bgWhite: f("\x1b[47m", "\x1b[49m"),
|
|
3936
|
-
blackBright: f("\x1b[90m", "\x1b[39m"),
|
|
3937
|
-
redBright: f("\x1b[91m", "\x1b[39m"),
|
|
3938
|
-
greenBright: f("\x1b[92m", "\x1b[39m"),
|
|
3939
|
-
yellowBright: f("\x1b[93m", "\x1b[39m"),
|
|
3940
|
-
blueBright: f("\x1b[94m", "\x1b[39m"),
|
|
3941
|
-
magentaBright: f("\x1b[95m", "\x1b[39m"),
|
|
3942
|
-
cyanBright: f("\x1b[96m", "\x1b[39m"),
|
|
3943
|
-
whiteBright: f("\x1b[97m", "\x1b[39m"),
|
|
3944
|
-
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
|
|
3945
|
-
bgRedBright: f("\x1b[101m", "\x1b[49m"),
|
|
3946
|
-
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
|
|
3947
|
-
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
|
|
3948
|
-
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
|
|
3949
|
-
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
|
|
3950
|
-
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
|
|
3951
|
-
bgWhiteBright: f("\x1b[107m", "\x1b[49m")
|
|
3952
|
-
};
|
|
3953
|
-
};
|
|
3954
|
-
module.exports = createColors();
|
|
3955
|
-
module.exports.createColors = createColors;
|
|
3956
|
-
},
|
|
3957
3886
|
"../../node_modules/.pnpm/pretty-format@30.2.0/node_modules/pretty-format/build/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
3958
3887
|
/*!
|
|
3959
3888
|
* /**
|
|
@@ -6690,1138 +6619,101 @@ var __webpack_modules__ = {
|
|
|
6690
6619
|
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
6691
6620
|
};
|
|
6692
6621
|
},
|
|
6693
|
-
"./src/runtime/util.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6694
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
6695
|
-
DW: ()=>checkPkgInstalled,
|
|
6696
|
-
nD: ()=>formatName,
|
|
6697
|
-
o9: ()=>formatTestError,
|
|
6698
|
-
zH: ()=>setRealTimers,
|
|
6699
|
-
si: ()=>TestRegisterError,
|
|
6700
|
-
rZ: ()=>getRealTimers
|
|
6701
|
-
});
|
|
6702
|
-
var external_node_module_ = __webpack_require__("node:module");
|
|
6703
|
-
var external_node_util_ = __webpack_require__("node:util");
|
|
6704
|
-
var build = __webpack_require__("../../node_modules/.pnpm/jest-diff@30.2.0/node_modules/jest-diff/build/index.js");
|
|
6705
|
-
build.DIFF_DELETE;
|
|
6706
|
-
build.DIFF_EQUAL;
|
|
6707
|
-
build.DIFF_INSERT;
|
|
6708
|
-
build.Diff;
|
|
6709
|
-
const diff = build.diff;
|
|
6710
|
-
build.diffLinesRaw;
|
|
6711
|
-
build.diffLinesUnified;
|
|
6712
|
-
build.diffLinesUnified2;
|
|
6713
|
-
build.diffStringsRaw;
|
|
6714
|
-
build.diffStringsUnified;
|
|
6715
|
-
const REAL_TIMERS = {};
|
|
6716
|
-
const setRealTimers = ()=>{
|
|
6717
|
-
REAL_TIMERS.setTimeout ??= globalThis.setTimeout;
|
|
6718
|
-
};
|
|
6719
|
-
const getRealTimers = ()=>REAL_TIMERS;
|
|
6720
|
-
const formatTestError = (err, test)=>{
|
|
6721
|
-
const errors = Array.isArray(err) ? err : [
|
|
6722
|
-
err
|
|
6723
|
-
];
|
|
6724
|
-
return errors.map((rawError)=>{
|
|
6725
|
-
const error = 'string' == typeof rawError ? {
|
|
6726
|
-
message: rawError
|
|
6727
|
-
} : rawError;
|
|
6728
|
-
const errObj = {
|
|
6729
|
-
...error,
|
|
6730
|
-
message: error.message,
|
|
6731
|
-
name: error.name,
|
|
6732
|
-
stack: error.stack
|
|
6733
|
-
};
|
|
6734
|
-
if (error instanceof TestRegisterError && test?.type === 'case') errObj.message = `Can't nest describe or test inside a test. ${error.message} because it is nested within test '${test.name}'`;
|
|
6735
|
-
if (error.showDiff || void 0 === error.showDiff && void 0 !== error.expected && void 0 !== error.actual) errObj.diff = diff(err.expected, err.actual, {
|
|
6736
|
-
expand: false
|
|
6737
|
-
});
|
|
6738
|
-
for (const key of [
|
|
6739
|
-
'actual',
|
|
6740
|
-
'expected'
|
|
6741
|
-
])if ('string' != typeof err[key]) errObj[key] = JSON.stringify(err[key], null, 10);
|
|
6742
|
-
return errObj;
|
|
6743
|
-
});
|
|
6744
|
-
};
|
|
6745
|
-
const formatRegExp = /%[sdjifoOc%]/;
|
|
6746
|
-
const formatName = (template, param, index)=>{
|
|
6747
|
-
let templateStr = template;
|
|
6748
|
-
if ([
|
|
6749
|
-
'%%',
|
|
6750
|
-
'%#',
|
|
6751
|
-
'%$'
|
|
6752
|
-
].some((flag)=>templateStr.includes(flag))) templateStr = templateStr.replace(/%%/g, '__rstest_escaped_%__').replace(/%#/g, `${index}`).replace(/%\$/g, `${index + 1}`).replace(/__rstest_escaped_%__/g, '%%');
|
|
6753
|
-
if (Array.isArray(param)) return formatRegExp.test(templateStr) ? (0, external_node_util_.format)(templateStr, ...param) : templateStr;
|
|
6754
|
-
if (formatRegExp.test(templateStr)) templateStr = (0, external_node_util_.format)(templateStr, param);
|
|
6755
|
-
return templateStr.replace(/\$([$\w.]+)/g, (_, key)=>{
|
|
6756
|
-
const value = getValue(param, key);
|
|
6757
|
-
return value?.toString();
|
|
6758
|
-
});
|
|
6759
|
-
};
|
|
6760
|
-
function getValue(source, path, defaultValue) {
|
|
6761
|
-
const paths = path.replace(/\[(\d+)\]/g, '.$1').split('.');
|
|
6762
|
-
let result = source;
|
|
6763
|
-
for (const p of paths){
|
|
6764
|
-
result = result[p];
|
|
6765
|
-
if (void 0 === result) return defaultValue;
|
|
6766
|
-
}
|
|
6767
|
-
return result;
|
|
6768
|
-
}
|
|
6769
|
-
class TestRegisterError extends Error {
|
|
6770
|
-
}
|
|
6771
|
-
class RstestError extends Error {
|
|
6772
|
-
fullStack;
|
|
6773
|
-
}
|
|
6774
|
-
function checkPkgInstalled(name) {
|
|
6775
|
-
const require = (0, external_node_module_.createRequire)(import.meta.url);
|
|
6776
|
-
try {
|
|
6777
|
-
require.resolve(name);
|
|
6778
|
-
} catch (error) {
|
|
6779
|
-
if ('MODULE_NOT_FOUND' === error.code) {
|
|
6780
|
-
const error = new RstestError(`Missing dependency "${name}". Please install it first.`);
|
|
6781
|
-
error.fullStack = true;
|
|
6782
|
-
throw error;
|
|
6783
|
-
}
|
|
6784
|
-
throw error;
|
|
6785
|
-
}
|
|
6786
|
-
}
|
|
6787
|
-
},
|
|
6788
|
-
"./src/runtime/worker/setup.ts": function() {
|
|
6789
|
-
const gracefulExit = process.execArgv.some((execArg)=>execArg.startsWith('--perf') || execArg.startsWith('--prof') || execArg.startsWith('--cpu-prof') || execArg.startsWith('--heap-prof') || execArg.startsWith('--diagnostic-dir'));
|
|
6790
|
-
if (gracefulExit) process.on('SIGTERM', ()=>{
|
|
6791
|
-
process.exit();
|
|
6792
|
-
});
|
|
6793
|
-
},
|
|
6794
|
-
"./src/utils/constants.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6795
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
6796
|
-
TE: ()=>globalApis,
|
|
6797
|
-
q_: ()=>ROOT_SUITE_NAME
|
|
6798
|
-
});
|
|
6799
|
-
const ROOT_SUITE_NAME = 'Rstest:_internal_root_suite';
|
|
6800
|
-
const globalApis = [
|
|
6801
|
-
'test',
|
|
6802
|
-
'describe',
|
|
6803
|
-
'it',
|
|
6804
|
-
'expect',
|
|
6805
|
-
'afterAll',
|
|
6806
|
-
'afterEach',
|
|
6807
|
-
'beforeAll',
|
|
6808
|
-
'beforeEach',
|
|
6809
|
-
'rstest',
|
|
6810
|
-
'rs',
|
|
6811
|
-
'assert',
|
|
6812
|
-
'onTestFinished',
|
|
6813
|
-
'onTestFailed'
|
|
6814
|
-
];
|
|
6815
|
-
},
|
|
6816
|
-
"./src/utils/helper.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6817
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
6818
|
-
Gv: ()=>isObject,
|
|
6819
|
-
bg: ()=>castArray,
|
|
6820
|
-
fN: ()=>getTaskNameWithPrefix,
|
|
6821
|
-
gy: ()=>undoSerializableConfig,
|
|
6822
|
-
kV: ()=>prettyTime,
|
|
6823
|
-
yW: ()=>picocolors__WEBPACK_IMPORTED_MODULE_1___default.a
|
|
6824
|
-
});
|
|
6825
|
-
var picocolors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
6826
|
-
var picocolors__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/ __webpack_require__.n(picocolors__WEBPACK_IMPORTED_MODULE_1__);
|
|
6827
|
-
__webpack_require__("./src/utils/constants.ts");
|
|
6828
|
-
const isObject = (obj)=>'[object Object]' === Object.prototype.toString.call(obj);
|
|
6829
|
-
const castArray = (arr)=>{
|
|
6830
|
-
if (void 0 === arr) return [];
|
|
6831
|
-
return Array.isArray(arr) ? arr : [
|
|
6832
|
-
arr
|
|
6833
|
-
];
|
|
6834
|
-
};
|
|
6835
|
-
const prettyTime = (milliseconds)=>{
|
|
6836
|
-
if (milliseconds < 1000) return `${Math.round(milliseconds)}ms`;
|
|
6837
|
-
const seconds = milliseconds / 1000;
|
|
6838
|
-
const getSecond = (seconds, needDigits)=>{
|
|
6839
|
-
if (!needDigits || seconds === Math.ceil(seconds)) return `${Math.round(seconds).toString()}s`;
|
|
6840
|
-
const digits = seconds < 10 ? seconds >= 0.01 ? 2 : 3 : 1;
|
|
6841
|
-
return `${seconds.toFixed(digits)}s`;
|
|
6842
|
-
};
|
|
6843
|
-
const minutes = Math.floor(seconds / 60);
|
|
6844
|
-
const secondsRemainder = seconds % 60;
|
|
6845
|
-
let time = '';
|
|
6846
|
-
if (minutes > 0) time += `${minutes}m`;
|
|
6847
|
-
if (secondsRemainder > 0) {
|
|
6848
|
-
if (minutes > 0) time += ' ';
|
|
6849
|
-
time += getSecond(secondsRemainder, !minutes);
|
|
6850
|
-
}
|
|
6851
|
-
return time;
|
|
6852
|
-
};
|
|
6853
|
-
const getTaskNames = (test)=>(test.parentNames || []).concat(test.name).filter(Boolean);
|
|
6854
|
-
const getTaskNameWithPrefix = (test, delimiter = ">")=>getTaskNames(test).join(` ${delimiter} `);
|
|
6855
|
-
const REGEXP_FLAG_PREFIX = 'RSTEST_REGEXP:';
|
|
6856
|
-
const unwrapRegex = (value)=>{
|
|
6857
|
-
if (value.startsWith(REGEXP_FLAG_PREFIX)) {
|
|
6858
|
-
const regexStr = value.slice(REGEXP_FLAG_PREFIX.length);
|
|
6859
|
-
const matches = regexStr.match(/^\/(.+)\/([gimuy]*)$/);
|
|
6860
|
-
if (matches) {
|
|
6861
|
-
const [, pattern, flags] = matches;
|
|
6862
|
-
return new RegExp(pattern, flags);
|
|
6863
|
-
}
|
|
6864
|
-
}
|
|
6865
|
-
return value;
|
|
6866
|
-
};
|
|
6867
|
-
const undoSerializableConfig = (normalizedConfig)=>{
|
|
6868
|
-
const { testNamePattern } = normalizedConfig;
|
|
6869
|
-
return {
|
|
6870
|
-
...normalizedConfig,
|
|
6871
|
-
testNamePattern: testNamePattern && 'string' == typeof testNamePattern ? unwrapRegex(testNamePattern) : testNamePattern
|
|
6872
|
-
};
|
|
6873
|
-
};
|
|
6874
|
-
},
|
|
6875
|
-
"./src/utils/index.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6876
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
6877
|
-
fN: ()=>helper.fN,
|
|
6878
|
-
Gv: ()=>helper.Gv,
|
|
6879
|
-
kV: ()=>helper.kV,
|
|
6880
|
-
q_: ()=>constants.q_,
|
|
6881
|
-
bg: ()=>helper.bg,
|
|
6882
|
-
yW: ()=>helper.yW
|
|
6883
|
-
});
|
|
6884
|
-
var constants = __webpack_require__("./src/utils/constants.ts");
|
|
6885
|
-
var helper = __webpack_require__("./src/utils/helper.ts");
|
|
6886
|
-
__webpack_require__("./src/utils/logger.ts");
|
|
6887
|
-
__webpack_require__("node:fs");
|
|
6888
|
-
__webpack_require__("node:fs/promises");
|
|
6889
|
-
__webpack_require__("node:module");
|
|
6890
|
-
},
|
|
6891
|
-
"./src/utils/logger.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6892
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
6893
|
-
vF: ()=>src_logger
|
|
6894
|
-
});
|
|
6895
|
-
var external_node_process_ = __webpack_require__("node:process");
|
|
6896
|
-
var external_node_os_ = __webpack_require__("node:os");
|
|
6897
|
-
var external_node_tty_ = __webpack_require__("node:tty");
|
|
6898
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : external_node_process_["default"].argv) {
|
|
6899
|
-
const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
|
|
6900
|
-
const position = argv.indexOf(prefix + flag);
|
|
6901
|
-
const terminatorPosition = argv.indexOf('--');
|
|
6902
|
-
return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
|
|
6903
|
-
}
|
|
6904
|
-
const { env } = external_node_process_["default"];
|
|
6905
|
-
let flagForceColor;
|
|
6906
|
-
if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) flagForceColor = 0;
|
|
6907
|
-
else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
|
|
6908
|
-
function envForceColor() {
|
|
6909
|
-
if (!('FORCE_COLOR' in env)) return;
|
|
6910
|
-
if ('true' === env.FORCE_COLOR) return 1;
|
|
6911
|
-
if ('false' === env.FORCE_COLOR) return 0;
|
|
6912
|
-
if (0 === env.FORCE_COLOR.length) return 1;
|
|
6913
|
-
const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
6914
|
-
if (![
|
|
6915
|
-
0,
|
|
6916
|
-
1,
|
|
6917
|
-
2,
|
|
6918
|
-
3
|
|
6919
|
-
].includes(level)) return;
|
|
6920
|
-
return level;
|
|
6921
|
-
}
|
|
6922
|
-
function translateLevel(level) {
|
|
6923
|
-
if (0 === level) return false;
|
|
6924
|
-
return {
|
|
6925
|
-
level,
|
|
6926
|
-
hasBasic: true,
|
|
6927
|
-
has256: level >= 2,
|
|
6928
|
-
has16m: level >= 3
|
|
6929
|
-
};
|
|
6930
|
-
}
|
|
6931
|
-
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
6932
|
-
const noFlagForceColor = envForceColor();
|
|
6933
|
-
if (void 0 !== noFlagForceColor) flagForceColor = noFlagForceColor;
|
|
6934
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
6935
|
-
if (0 === forceColor) return 0;
|
|
6936
|
-
if (sniffFlags) {
|
|
6937
|
-
if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) return 3;
|
|
6938
|
-
if (hasFlag('color=256')) return 2;
|
|
6939
|
-
}
|
|
6940
|
-
if ('TF_BUILD' in env && 'AGENT_NAME' in env) return 1;
|
|
6941
|
-
if (haveStream && !streamIsTTY && void 0 === forceColor) return 0;
|
|
6942
|
-
const min = forceColor || 0;
|
|
6943
|
-
if ('dumb' === env.TERM) return min;
|
|
6944
|
-
if ('win32' === external_node_process_["default"].platform) {
|
|
6945
|
-
const osRelease = external_node_os_["default"].release().split('.');
|
|
6946
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
6947
|
-
return 1;
|
|
6948
|
-
}
|
|
6949
|
-
if ('CI' in env) {
|
|
6950
|
-
if ([
|
|
6951
|
-
'GITHUB_ACTIONS',
|
|
6952
|
-
'GITEA_ACTIONS',
|
|
6953
|
-
'CIRCLECI'
|
|
6954
|
-
].some((key)=>key in env)) return 3;
|
|
6955
|
-
if ([
|
|
6956
|
-
'TRAVIS',
|
|
6957
|
-
'APPVEYOR',
|
|
6958
|
-
'GITLAB_CI',
|
|
6959
|
-
'BUILDKITE',
|
|
6960
|
-
'DRONE'
|
|
6961
|
-
].some((sign)=>sign in env) || 'codeship' === env.CI_NAME) return 1;
|
|
6962
|
-
return min;
|
|
6963
|
-
}
|
|
6964
|
-
if ('TEAMCITY_VERSION' in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
6965
|
-
if ('truecolor' === env.COLORTERM) return 3;
|
|
6966
|
-
if ('xterm-kitty' === env.TERM) return 3;
|
|
6967
|
-
if ('xterm-ghostty' === env.TERM) return 3;
|
|
6968
|
-
if ('wezterm' === env.TERM) return 3;
|
|
6969
|
-
if ('TERM_PROGRAM' in env) {
|
|
6970
|
-
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
6971
|
-
switch(env.TERM_PROGRAM){
|
|
6972
|
-
case 'iTerm.app':
|
|
6973
|
-
return version >= 3 ? 3 : 2;
|
|
6974
|
-
case 'Apple_Terminal':
|
|
6975
|
-
return 2;
|
|
6976
|
-
}
|
|
6977
|
-
}
|
|
6978
|
-
if (/-256(color)?$/i.test(env.TERM)) return 2;
|
|
6979
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
|
|
6980
|
-
if ('COLORTERM' in env) return 1;
|
|
6981
|
-
return min;
|
|
6982
|
-
}
|
|
6983
|
-
function createSupportsColor(stream, options = {}) {
|
|
6984
|
-
const level = _supportsColor(stream, {
|
|
6985
|
-
streamIsTTY: stream && stream.isTTY,
|
|
6986
|
-
...options
|
|
6987
|
-
});
|
|
6988
|
-
return translateLevel(level);
|
|
6989
|
-
}
|
|
6990
|
-
const supportsColor = {
|
|
6991
|
-
stdout: createSupportsColor({
|
|
6992
|
-
isTTY: external_node_tty_["default"].isatty(1)
|
|
6993
|
-
}),
|
|
6994
|
-
stderr: createSupportsColor({
|
|
6995
|
-
isTTY: external_node_tty_["default"].isatty(2)
|
|
6996
|
-
})
|
|
6997
|
-
};
|
|
6998
|
-
const supports_color = supportsColor;
|
|
6999
|
-
const colorLevel = supports_color.stdout ? supports_color.stdout.level : 0;
|
|
7000
|
-
let errorStackRegExp = /at\s.*:\d+:\d+[\s\)]*$/;
|
|
7001
|
-
let anonymousErrorStackRegExp = /at\s.*\(<anonymous>\)$/;
|
|
7002
|
-
let isErrorStackMessage = (message)=>errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message);
|
|
7003
|
-
let formatter = (open, close, replace = open)=>colorLevel >= 2 ? (input)=>{
|
|
7004
|
-
let string = '' + input;
|
|
7005
|
-
let index = string.indexOf(close, open.length);
|
|
7006
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
7007
|
-
} : String;
|
|
7008
|
-
let replaceClose = (string, close, replace, index)=>{
|
|
7009
|
-
let start = string.substring(0, index) + replace;
|
|
7010
|
-
let end = string.substring(index + close.length);
|
|
7011
|
-
let nextIndex = end.indexOf(close);
|
|
7012
|
-
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
|
|
7013
|
-
};
|
|
7014
|
-
const bold = formatter('\x1b[1m', '\x1b[22m', '\x1b[22m\x1b[1m');
|
|
7015
|
-
const red = formatter('\x1b[31m', '\x1b[39m');
|
|
7016
|
-
const green = formatter('\x1b[32m', '\x1b[39m');
|
|
7017
|
-
const yellow = formatter('\x1b[33m', '\x1b[39m');
|
|
7018
|
-
const magenta = formatter('\x1b[35m', '\x1b[39m');
|
|
7019
|
-
const cyan = formatter('\x1b[36m', '\x1b[39m');
|
|
7020
|
-
const gray = formatter('\x1b[90m', '\x1b[39m');
|
|
7021
|
-
let startColor = [
|
|
7022
|
-
189,
|
|
7023
|
-
255,
|
|
7024
|
-
243
|
|
7025
|
-
];
|
|
7026
|
-
let endColor = [
|
|
7027
|
-
74,
|
|
7028
|
-
194,
|
|
7029
|
-
154
|
|
7030
|
-
];
|
|
7031
|
-
let isWord = (char)=>!/[\s\n]/.test(char);
|
|
7032
|
-
let gradient = (message)=>{
|
|
7033
|
-
if (colorLevel < 3) return 2 === colorLevel ? bold(cyan(message)) : message;
|
|
7034
|
-
let chars = [
|
|
7035
|
-
...message
|
|
7036
|
-
];
|
|
7037
|
-
let steps = chars.filter(isWord).length;
|
|
7038
|
-
let r = startColor[0];
|
|
7039
|
-
let g = startColor[1];
|
|
7040
|
-
let b = startColor[2];
|
|
7041
|
-
let rStep = (endColor[0] - r) / steps;
|
|
7042
|
-
let gStep = (endColor[1] - g) / steps;
|
|
7043
|
-
let bStep = (endColor[2] - b) / steps;
|
|
7044
|
-
let output = '';
|
|
7045
|
-
for (let char of chars){
|
|
7046
|
-
if (isWord(char)) {
|
|
7047
|
-
r += rStep;
|
|
7048
|
-
g += gStep;
|
|
7049
|
-
b += bStep;
|
|
7050
|
-
}
|
|
7051
|
-
output += `\x1b[38;2;${Math.round(r)};${Math.round(g)};${Math.round(b)}m${char}\x1b[39m`;
|
|
7052
|
-
}
|
|
7053
|
-
return bold(output);
|
|
7054
|
-
};
|
|
7055
|
-
let LOG_LEVEL = {
|
|
7056
|
-
silent: -1,
|
|
7057
|
-
error: 0,
|
|
7058
|
-
warn: 1,
|
|
7059
|
-
info: 2,
|
|
7060
|
-
log: 2,
|
|
7061
|
-
verbose: 3
|
|
7062
|
-
};
|
|
7063
|
-
let LOG_TYPES = {
|
|
7064
|
-
error: {
|
|
7065
|
-
label: 'error',
|
|
7066
|
-
level: 'error',
|
|
7067
|
-
color: red
|
|
7068
|
-
},
|
|
7069
|
-
warn: {
|
|
7070
|
-
label: 'warn',
|
|
7071
|
-
level: 'warn',
|
|
7072
|
-
color: yellow
|
|
7073
|
-
},
|
|
7074
|
-
info: {
|
|
7075
|
-
label: 'info',
|
|
7076
|
-
level: 'info',
|
|
7077
|
-
color: cyan
|
|
7078
|
-
},
|
|
7079
|
-
start: {
|
|
7080
|
-
label: 'start',
|
|
7081
|
-
level: 'info',
|
|
7082
|
-
color: cyan
|
|
7083
|
-
},
|
|
7084
|
-
ready: {
|
|
7085
|
-
label: 'ready',
|
|
7086
|
-
level: 'info',
|
|
7087
|
-
color: green
|
|
7088
|
-
},
|
|
7089
|
-
success: {
|
|
7090
|
-
label: 'success',
|
|
7091
|
-
level: 'info',
|
|
7092
|
-
color: green
|
|
7093
|
-
},
|
|
7094
|
-
log: {
|
|
7095
|
-
level: 'info'
|
|
7096
|
-
},
|
|
7097
|
-
debug: {
|
|
7098
|
-
label: 'debug',
|
|
7099
|
-
level: 'verbose',
|
|
7100
|
-
color: magenta
|
|
7101
|
-
}
|
|
7102
|
-
};
|
|
7103
|
-
const normalizeErrorMessage = (err)=>{
|
|
7104
|
-
if (err.stack) {
|
|
7105
|
-
let [name, ...rest] = err.stack.split('\n');
|
|
7106
|
-
if (name.startsWith('Error: ')) name = name.slice(7);
|
|
7107
|
-
return `${name}\n${gray(rest.join('\n'))}`;
|
|
7108
|
-
}
|
|
7109
|
-
return err.message;
|
|
7110
|
-
};
|
|
7111
|
-
let createLogger = (options = {})=>{
|
|
7112
|
-
let maxLevel = options.level || 'info';
|
|
7113
|
-
let log = (type, message, ...args)=>{
|
|
7114
|
-
if (LOG_LEVEL[LOG_TYPES[type].level] > LOG_LEVEL[maxLevel]) return;
|
|
7115
|
-
if (null == message) return console.log();
|
|
7116
|
-
let logType = LOG_TYPES[type];
|
|
7117
|
-
let label = '';
|
|
7118
|
-
let text = '';
|
|
7119
|
-
if ('label' in logType) {
|
|
7120
|
-
label = (logType.label || '').padEnd(7);
|
|
7121
|
-
label = bold(logType.color ? logType.color(label) : label);
|
|
7122
|
-
}
|
|
7123
|
-
if (message instanceof Error) {
|
|
7124
|
-
text += normalizeErrorMessage(message);
|
|
7125
|
-
const { cause } = message;
|
|
7126
|
-
if (cause) {
|
|
7127
|
-
text += yellow('\n [cause]: ');
|
|
7128
|
-
text += cause instanceof Error ? normalizeErrorMessage(cause) : String(cause);
|
|
7129
|
-
}
|
|
7130
|
-
} else if ('error' === logType.level && 'string' == typeof message) {
|
|
7131
|
-
let lines = message.split('\n');
|
|
7132
|
-
text = lines.map((line)=>isErrorStackMessage(line) ? gray(line) : line).join('\n');
|
|
7133
|
-
} else text = `${message}`;
|
|
7134
|
-
console.log(label.length ? `${label} ${text}` : text, ...args);
|
|
7135
|
-
};
|
|
7136
|
-
let logger = {
|
|
7137
|
-
greet: (message)=>log('log', gradient(message))
|
|
7138
|
-
};
|
|
7139
|
-
Object.keys(LOG_TYPES).forEach((key)=>{
|
|
7140
|
-
logger[key] = (...args)=>log(key, ...args);
|
|
7141
|
-
});
|
|
7142
|
-
Object.defineProperty(logger, 'level', {
|
|
7143
|
-
get: ()=>maxLevel,
|
|
7144
|
-
set (val) {
|
|
7145
|
-
maxLevel = val;
|
|
7146
|
-
}
|
|
7147
|
-
});
|
|
7148
|
-
logger.override = (customLogger)=>{
|
|
7149
|
-
Object.assign(logger, customLogger);
|
|
7150
|
-
};
|
|
7151
|
-
return logger;
|
|
7152
|
-
};
|
|
7153
|
-
let src_logger = createLogger();
|
|
7154
|
-
var helper = __webpack_require__("./src/utils/helper.ts");
|
|
7155
|
-
const isDebug = ()=>{
|
|
7156
|
-
if (!process.env.DEBUG) return false;
|
|
7157
|
-
const values = process.env.DEBUG.toLocaleLowerCase().split(',');
|
|
7158
|
-
return [
|
|
7159
|
-
'rstest',
|
|
7160
|
-
'rsbuild',
|
|
7161
|
-
'builder',
|
|
7162
|
-
'*'
|
|
7163
|
-
].some((key)=>values.includes(key));
|
|
7164
|
-
};
|
|
7165
|
-
if (isDebug()) src_logger.level = 'verbose';
|
|
7166
|
-
function getTime() {
|
|
7167
|
-
const now = new Date();
|
|
7168
|
-
const hours = String(now.getHours()).padStart(2, '0');
|
|
7169
|
-
const minutes = String(now.getMinutes()).padStart(2, '0');
|
|
7170
|
-
const seconds = String(now.getSeconds()).padStart(2, '0');
|
|
7171
|
-
return `${hours}:${minutes}:${seconds}`;
|
|
7172
|
-
}
|
|
7173
|
-
src_logger.override({
|
|
7174
|
-
debug: (message, ...args)=>{
|
|
7175
|
-
if ('verbose' !== src_logger.level) return;
|
|
7176
|
-
const time = helper.yW.gray(getTime());
|
|
7177
|
-
console.log(` ${helper.yW.magenta('rstest')} ${time} ${message}`, ...args);
|
|
7178
|
-
}
|
|
7179
|
-
});
|
|
7180
|
-
},
|
|
7181
6622
|
timers: function(module) {
|
|
7182
6623
|
module.exports = require("timers");
|
|
7183
6624
|
},
|
|
7184
6625
|
"timers/promises": function(module) {
|
|
7185
6626
|
module.exports = require("timers/promises");
|
|
7186
|
-
},
|
|
7187
|
-
"node:fs": function(module) {
|
|
7188
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__;
|
|
7189
|
-
},
|
|
7190
|
-
"node:fs/promises": function(module) {
|
|
7191
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_node_fs_promises_153e37e0__;
|
|
7192
|
-
},
|
|
7193
|
-
"node:module": function(module) {
|
|
7194
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__;
|
|
7195
|
-
},
|
|
7196
|
-
"node:os": function(module) {
|
|
7197
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__;
|
|
7198
|
-
},
|
|
7199
|
-
"node:path": function(module) {
|
|
7200
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__;
|
|
7201
|
-
},
|
|
7202
|
-
"node:process": function(module) {
|
|
7203
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__;
|
|
7204
|
-
},
|
|
7205
|
-
"node:tty": function(module) {
|
|
7206
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_node_tty_c64aab7e__;
|
|
7207
|
-
},
|
|
7208
|
-
"node:util": function(module) {
|
|
7209
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__;
|
|
7210
|
-
},
|
|
7211
|
-
"../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
7212
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
7213
|
-
_: ()=>_path,
|
|
7214
|
-
c: ()=>basename,
|
|
7215
|
-
d: ()=>dirname,
|
|
7216
|
-
i: ()=>isAbsolute,
|
|
7217
|
-
j: ()=>join,
|
|
7218
|
-
r: ()=>resolve
|
|
7219
|
-
});
|
|
7220
|
-
let _lazyMatch = ()=>{
|
|
7221
|
-
var __lib__ = (()=>{
|
|
7222
|
-
var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e)=>{
|
|
7223
|
-
for(var n in e)m(r, n, {
|
|
7224
|
-
get: e[n],
|
|
7225
|
-
enumerable: true
|
|
7226
|
-
});
|
|
7227
|
-
}, H = (r, e, n, a)=>{
|
|
7228
|
-
if (e && "object" == typeof e || "function" == typeof e) for (let t of G(e))T.call(r, t) || t === n || m(r, t, {
|
|
7229
|
-
get: ()=>e[t],
|
|
7230
|
-
enumerable: !(a = V(e, t)) || a.enumerable
|
|
7231
|
-
});
|
|
7232
|
-
return r;
|
|
7233
|
-
}, J = (r)=>H(m({}, "__esModule", {
|
|
7234
|
-
value: true
|
|
7235
|
-
}), r), w = {};
|
|
7236
|
-
q(w, {
|
|
7237
|
-
default: ()=>re
|
|
7238
|
-
});
|
|
7239
|
-
var A = (r)=>Array.isArray(r), d = (r)=>"function" == typeof r, Q = (r)=>0 === r.length, W = (r)=>"number" == typeof r, K = (r)=>"object" == typeof r && null !== r, X = (r)=>r instanceof RegExp, b = (r)=>"string" == typeof r, h = (r)=>void 0 === r, Y = (r)=>{
|
|
7240
|
-
const e = new Map;
|
|
7241
|
-
return (n)=>{
|
|
7242
|
-
const a = e.get(n);
|
|
7243
|
-
if (a) return a;
|
|
7244
|
-
const t = r(n);
|
|
7245
|
-
return e.set(n, t), t;
|
|
7246
|
-
};
|
|
7247
|
-
}, rr = (r, e, n = {})=>{
|
|
7248
|
-
const a = {
|
|
7249
|
-
cache: {},
|
|
7250
|
-
input: r,
|
|
7251
|
-
index: 0,
|
|
7252
|
-
indexMax: 0,
|
|
7253
|
-
options: n,
|
|
7254
|
-
output: []
|
|
7255
|
-
};
|
|
7256
|
-
if (v(e)(a) && a.index === r.length) return a.output;
|
|
7257
|
-
throw new Error(`Failed to parse at index ${a.indexMax}`);
|
|
7258
|
-
}, i = (r, e)=>A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e)=>{
|
|
7259
|
-
const n = {};
|
|
7260
|
-
for (const a of r){
|
|
7261
|
-
if (1 !== a.length) throw new Error(`Invalid character: "${a}"`);
|
|
7262
|
-
const t = a.charCodeAt(0);
|
|
7263
|
-
n[t] = true;
|
|
7264
|
-
}
|
|
7265
|
-
return (a)=>{
|
|
7266
|
-
const t = a.index, o = a.input;
|
|
7267
|
-
for(; a.index < o.length && o.charCodeAt(a.index) in n;)a.index += 1;
|
|
7268
|
-
const u = a.index;
|
|
7269
|
-
if (u > t) {
|
|
7270
|
-
if (!h(e) && !a.options.silent) {
|
|
7271
|
-
const s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
|
|
7272
|
-
h(c) || a.output.push(c);
|
|
7273
|
-
}
|
|
7274
|
-
a.indexMax = Math.max(a.indexMax, a.index);
|
|
7275
|
-
}
|
|
7276
|
-
return true;
|
|
7277
|
-
};
|
|
7278
|
-
}, nr = (r, e)=>{
|
|
7279
|
-
const n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
|
|
7280
|
-
return g((o)=>{
|
|
7281
|
-
t.lastIndex = o.index;
|
|
7282
|
-
const u = t.exec(o.input);
|
|
7283
|
-
if (!u) return false;
|
|
7284
|
-
if (!h(e) && !o.options.silent) {
|
|
7285
|
-
const s = d(e) ? e(...u, o.input, String(o.index)) : e;
|
|
7286
|
-
h(s) || o.output.push(s);
|
|
7287
|
-
}
|
|
7288
|
-
return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), true;
|
|
7289
|
-
});
|
|
7290
|
-
}, ar = (r, e)=>(n)=>{
|
|
7291
|
-
if (!n.input.startsWith(r, n.index)) return false;
|
|
7292
|
-
if (!h(e) && !n.options.silent) {
|
|
7293
|
-
const t = d(e) ? e(r, n.input, String(n.index)) : e;
|
|
7294
|
-
h(t) || n.output.push(t);
|
|
7295
|
-
}
|
|
7296
|
-
return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), true;
|
|
7297
|
-
}, C = (r, e, n, a)=>{
|
|
7298
|
-
const t = v(r);
|
|
7299
|
-
return g(_(M((o)=>{
|
|
7300
|
-
let u = 0;
|
|
7301
|
-
for(; u < n;){
|
|
7302
|
-
const s = o.index;
|
|
7303
|
-
if (!t(o) || (u += 1, o.index === s)) break;
|
|
7304
|
-
}
|
|
7305
|
-
return u >= e;
|
|
7306
|
-
})));
|
|
7307
|
-
}, tr = (r, e)=>C(r, 0, 1), f = (r, e)=>C(r, 0, 1 / 0), x = (r, e)=>{
|
|
7308
|
-
const n = r.map(v);
|
|
7309
|
-
return g(_(M((a)=>{
|
|
7310
|
-
for(let t = 0, o = n.length; t < o; t++)if (!n[t](a)) return false;
|
|
7311
|
-
return true;
|
|
7312
|
-
})));
|
|
7313
|
-
}, l = (r, e)=>{
|
|
7314
|
-
const n = r.map(v);
|
|
7315
|
-
return g(_((a)=>{
|
|
7316
|
-
for(let t = 0, o = n.length; t < o; t++)if (n[t](a)) return true;
|
|
7317
|
-
return false;
|
|
7318
|
-
}));
|
|
7319
|
-
}, M = (r, e = false)=>{
|
|
7320
|
-
const n = v(r);
|
|
7321
|
-
return (a)=>{
|
|
7322
|
-
const t = a.index, o = a.output.length, u = n(a);
|
|
7323
|
-
return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
|
|
7324
|
-
};
|
|
7325
|
-
}, _ = (r, e)=>{
|
|
7326
|
-
const n = v(r);
|
|
7327
|
-
return n;
|
|
7328
|
-
}, g = (()=>{
|
|
7329
|
-
let r = 0;
|
|
7330
|
-
return (e)=>{
|
|
7331
|
-
const n = v(e), a = r += 1;
|
|
7332
|
-
return (t)=>{
|
|
7333
|
-
var o;
|
|
7334
|
-
if (false === t.options.memoization) return n(t);
|
|
7335
|
-
const u = t.index, s = (o = t.cache)[a] || (o[a] = new Map), c = s.get(u);
|
|
7336
|
-
if (false === c) return false;
|
|
7337
|
-
if (W(c)) return t.index = c, true;
|
|
7338
|
-
if (c) return t.index = c.index, c.output?.length && t.output.push(...c.output), true;
|
|
7339
|
-
{
|
|
7340
|
-
const Z = t.output.length;
|
|
7341
|
-
if (!n(t)) return s.set(u, false), false;
|
|
7342
|
-
{
|
|
7343
|
-
const D = t.index, U = t.output.length;
|
|
7344
|
-
if (U > Z) {
|
|
7345
|
-
const ee = t.output.slice(Z, U);
|
|
7346
|
-
s.set(u, {
|
|
7347
|
-
index: D,
|
|
7348
|
-
output: ee
|
|
7349
|
-
});
|
|
7350
|
-
} else s.set(u, D);
|
|
7351
|
-
return true;
|
|
7352
|
-
}
|
|
7353
|
-
}
|
|
7354
|
-
};
|
|
7355
|
-
};
|
|
7356
|
-
})(), E = (r)=>{
|
|
7357
|
-
let e;
|
|
7358
|
-
return (n)=>(e || (e = v(r())), e(n));
|
|
7359
|
-
}, v = Y((r)=>{
|
|
7360
|
-
if (d(r)) return Q(r) ? E(r) : r;
|
|
7361
|
-
if (b(r) || X(r)) return i(r);
|
|
7362
|
-
if (A(r)) return x(r);
|
|
7363
|
-
if (K(r)) return l(Object.values(r));
|
|
7364
|
-
throw new Error("Invalid rule");
|
|
7365
|
-
}), P = "abcdefghijklmnopqrstuvwxyz", ir = (r)=>{
|
|
7366
|
-
let e = "";
|
|
7367
|
-
for(; r > 0;){
|
|
7368
|
-
const n = (r - 1) % 26;
|
|
7369
|
-
e = P[n] + e, r = Math.floor((r - 1) / 26);
|
|
7370
|
-
}
|
|
7371
|
-
return e;
|
|
7372
|
-
}, O = (r)=>{
|
|
7373
|
-
let e = 0;
|
|
7374
|
-
for(let n = 0, a = r.length; n < a; n++)e = 26 * e + P.indexOf(r[n]) + 1;
|
|
7375
|
-
return e;
|
|
7376
|
-
}, S = (r, e)=>{
|
|
7377
|
-
if (e < r) return S(e, r);
|
|
7378
|
-
const n = [];
|
|
7379
|
-
for(; r <= e;)n.push(r++);
|
|
7380
|
-
return n;
|
|
7381
|
-
}, or = (r, e, n)=>S(r, e).map((a)=>String(a).padStart(n, "0")), R = (r, e)=>S(O(r), O(e)).map(ir), p = (r)=>r, z = (r)=>ur((e)=>rr(e, r, {
|
|
7382
|
-
memoization: false
|
|
7383
|
-
}).join("")), ur = (r)=>{
|
|
7384
|
-
const e = {};
|
|
7385
|
-
return (n)=>e[n] ?? (e[n] = r(n));
|
|
7386
|
-
}, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n)=>`.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a)=>`.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r)=>`\\${r}`), vr = i(/./, p), hr = i(/^(?:!!)*!(.*)$/, (r, e)=>`(?!^${L(e)}$).*?`), dr = i(/^(!!)+/, ""), fr = l([
|
|
7387
|
-
hr,
|
|
7388
|
-
dr
|
|
7389
|
-
]), xr = i(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i(/\/(\*\*)$/, "(?:/.*|$)"), _r = i(/\*\*/, ".*"), j = l([
|
|
7390
|
-
xr,
|
|
7391
|
-
gr,
|
|
7392
|
-
mr,
|
|
7393
|
-
_r
|
|
7394
|
-
]), Sr = i(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i(/\*/, "[^/]*"), N = l([
|
|
7395
|
-
Sr,
|
|
7396
|
-
yr
|
|
7397
|
-
]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i(/[$.*+?^(){}[\|]/, (r)=>`\\${r}`), Mr = i(/[^\]]/, p), Er = l([
|
|
7398
|
-
y,
|
|
7399
|
-
Cr,
|
|
7400
|
-
br,
|
|
7401
|
-
Mr
|
|
7402
|
-
]), B = x([
|
|
7403
|
-
$r,
|
|
7404
|
-
tr(Ar),
|
|
7405
|
-
f(Er),
|
|
7406
|
-
wr
|
|
7407
|
-
]), Pr = i("{", "(?:"), Or = i("}", ")"), Rr = i(/(\d+)\.\.(\d+)/, (r, e, n)=>or(+e, +n, Math.min(e.length, n.length)).join("|")), zr = i(/([a-z]+)\.\.([a-z]+)/, (r, e, n)=>R(e, n).join("|")), jr = i(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n)=>R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([
|
|
7408
|
-
Rr,
|
|
7409
|
-
zr,
|
|
7410
|
-
jr
|
|
7411
|
-
]), I = x([
|
|
7412
|
-
Pr,
|
|
7413
|
-
Nr,
|
|
7414
|
-
Or
|
|
7415
|
-
]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r)=>`\\${r}`), Lr = i(/[^}]/, p), Zr = E(()=>F), Dr = l([
|
|
7416
|
-
j,
|
|
7417
|
-
N,
|
|
7418
|
-
k,
|
|
7419
|
-
B,
|
|
7420
|
-
I,
|
|
7421
|
-
Zr,
|
|
7422
|
-
y,
|
|
7423
|
-
Fr,
|
|
7424
|
-
Ir,
|
|
7425
|
-
Lr
|
|
7426
|
-
]), F = x([
|
|
7427
|
-
kr,
|
|
7428
|
-
f(Dr),
|
|
7429
|
-
Br
|
|
7430
|
-
]), Ur = f(l([
|
|
7431
|
-
sr,
|
|
7432
|
-
cr,
|
|
7433
|
-
lr,
|
|
7434
|
-
fr,
|
|
7435
|
-
j,
|
|
7436
|
-
N,
|
|
7437
|
-
k,
|
|
7438
|
-
B,
|
|
7439
|
-
I,
|
|
7440
|
-
F,
|
|
7441
|
-
y,
|
|
7442
|
-
pr,
|
|
7443
|
-
vr
|
|
7444
|
-
])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i(/\\./, p), qr = i(/./, p), Hr = i(/\*\*\*+/, "*"), Jr = i(/([^/{[(!])\*\*/, (r, e)=>`${e}*`), Qr = i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e)=>`${e}*`), Wr = f(l([
|
|
7445
|
-
Tr,
|
|
7446
|
-
Hr,
|
|
7447
|
-
Jr,
|
|
7448
|
-
Qr,
|
|
7449
|
-
qr
|
|
7450
|
-
])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r, e)=>{
|
|
7451
|
-
const n = Array.isArray(r) ? r : [
|
|
7452
|
-
r
|
|
7453
|
-
];
|
|
7454
|
-
if (!n.length) return false;
|
|
7455
|
-
const a = n.map($.compile), t = n.every((s)=>/(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
|
|
7456
|
-
return a.some((s)=>s.test(o));
|
|
7457
|
-
};
|
|
7458
|
-
$.compile = (r)=>new RegExp(`^${L(Yr(r))}$`, "s");
|
|
7459
|
-
var re = $;
|
|
7460
|
-
return J(w);
|
|
7461
|
-
})();
|
|
7462
|
-
return __lib__.default || __lib__;
|
|
7463
|
-
};
|
|
7464
|
-
let _match;
|
|
7465
|
-
const zeptomatch = (path, pattern)=>{
|
|
7466
|
-
if (!_match) {
|
|
7467
|
-
_match = _lazyMatch();
|
|
7468
|
-
_lazyMatch = null;
|
|
7469
|
-
}
|
|
7470
|
-
return _match(path, pattern);
|
|
7471
|
-
};
|
|
7472
|
-
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
7473
|
-
function normalizeWindowsPath(input = "") {
|
|
7474
|
-
if (!input) return input;
|
|
7475
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r)=>r.toUpperCase());
|
|
7476
|
-
}
|
|
7477
|
-
const _UNC_REGEX = /^[/\\]{2}/;
|
|
7478
|
-
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
7479
|
-
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
7480
|
-
const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
7481
|
-
const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
|
|
7482
|
-
const _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
|
|
7483
|
-
const sep = "/";
|
|
7484
|
-
const normalize = function(path) {
|
|
7485
|
-
if (0 === path.length) return ".";
|
|
7486
|
-
path = normalizeWindowsPath(path);
|
|
7487
|
-
const isUNCPath = path.match(_UNC_REGEX);
|
|
7488
|
-
const isPathAbsolute = isAbsolute(path);
|
|
7489
|
-
const trailingSeparator = "/" === path[path.length - 1];
|
|
7490
|
-
path = normalizeString(path, !isPathAbsolute);
|
|
7491
|
-
if (0 === path.length) {
|
|
7492
|
-
if (isPathAbsolute) return "/";
|
|
7493
|
-
return trailingSeparator ? "./" : ".";
|
|
7494
|
-
}
|
|
7495
|
-
if (trailingSeparator) path += "/";
|
|
7496
|
-
if (_DRIVE_LETTER_RE.test(path)) path += "/";
|
|
7497
|
-
if (isUNCPath) {
|
|
7498
|
-
if (!isPathAbsolute) return `//./${path}`;
|
|
7499
|
-
return `//${path}`;
|
|
7500
|
-
}
|
|
7501
|
-
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
7502
|
-
};
|
|
7503
|
-
const join = function(...segments) {
|
|
7504
|
-
let path = "";
|
|
7505
|
-
for (const seg of segments)if (seg) if (path.length > 0) {
|
|
7506
|
-
const pathTrailing = "/" === path[path.length - 1];
|
|
7507
|
-
const segLeading = "/" === seg[0];
|
|
7508
|
-
const both = pathTrailing && segLeading;
|
|
7509
|
-
if (both) path += seg.slice(1);
|
|
7510
|
-
else path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
7511
|
-
} else path += seg;
|
|
7512
|
-
return normalize(path);
|
|
7513
|
-
};
|
|
7514
|
-
function cwd() {
|
|
7515
|
-
if ("undefined" != typeof process && "function" == typeof process.cwd) return process.cwd().replace(/\\/g, "/");
|
|
7516
|
-
return "/";
|
|
7517
|
-
}
|
|
7518
|
-
const resolve = function(...arguments_) {
|
|
7519
|
-
arguments_ = arguments_.map((argument)=>normalizeWindowsPath(argument));
|
|
7520
|
-
let resolvedPath = "";
|
|
7521
|
-
let resolvedAbsolute = false;
|
|
7522
|
-
for(let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--){
|
|
7523
|
-
const path = index >= 0 ? arguments_[index] : cwd();
|
|
7524
|
-
if (path && 0 !== path.length) {
|
|
7525
|
-
resolvedPath = `${path}/${resolvedPath}`;
|
|
7526
|
-
resolvedAbsolute = isAbsolute(path);
|
|
7527
|
-
}
|
|
7528
|
-
}
|
|
7529
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
7530
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
|
|
7531
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
7532
|
-
};
|
|
7533
|
-
function normalizeString(path, allowAboveRoot) {
|
|
7534
|
-
let res = "";
|
|
7535
|
-
let lastSegmentLength = 0;
|
|
7536
|
-
let lastSlash = -1;
|
|
7537
|
-
let dots = 0;
|
|
7538
|
-
let char = null;
|
|
7539
|
-
for(let index = 0; index <= path.length; ++index){
|
|
7540
|
-
if (index < path.length) char = path[index];
|
|
7541
|
-
else if ("/" === char) break;
|
|
7542
|
-
else char = "/";
|
|
7543
|
-
if ("/" === char) {
|
|
7544
|
-
if (lastSlash === index - 1 || 1 === dots) ;
|
|
7545
|
-
else if (2 === dots) {
|
|
7546
|
-
if (res.length < 2 || 2 !== lastSegmentLength || "." !== res[res.length - 1] || "." !== res[res.length - 2]) {
|
|
7547
|
-
if (res.length > 2) {
|
|
7548
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
7549
|
-
if (-1 === lastSlashIndex) {
|
|
7550
|
-
res = "";
|
|
7551
|
-
lastSegmentLength = 0;
|
|
7552
|
-
} else {
|
|
7553
|
-
res = res.slice(0, lastSlashIndex);
|
|
7554
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
7555
|
-
}
|
|
7556
|
-
lastSlash = index;
|
|
7557
|
-
dots = 0;
|
|
7558
|
-
continue;
|
|
7559
|
-
} else if (res.length > 0) {
|
|
7560
|
-
res = "";
|
|
7561
|
-
lastSegmentLength = 0;
|
|
7562
|
-
lastSlash = index;
|
|
7563
|
-
dots = 0;
|
|
7564
|
-
continue;
|
|
7565
|
-
}
|
|
7566
|
-
}
|
|
7567
|
-
if (allowAboveRoot) {
|
|
7568
|
-
res += res.length > 0 ? "/.." : "..";
|
|
7569
|
-
lastSegmentLength = 2;
|
|
7570
|
-
}
|
|
7571
|
-
} else {
|
|
7572
|
-
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
7573
|
-
else res = path.slice(lastSlash + 1, index);
|
|
7574
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
7575
|
-
}
|
|
7576
|
-
lastSlash = index;
|
|
7577
|
-
dots = 0;
|
|
7578
|
-
} else if ("." === char && -1 !== dots) ++dots;
|
|
7579
|
-
else dots = -1;
|
|
7580
|
-
}
|
|
7581
|
-
return res;
|
|
7582
|
-
}
|
|
7583
|
-
const isAbsolute = function(p) {
|
|
7584
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
7585
|
-
};
|
|
7586
|
-
const toNamespacedPath = function(p) {
|
|
7587
|
-
return normalizeWindowsPath(p);
|
|
7588
|
-
};
|
|
7589
|
-
const extname = function(p) {
|
|
7590
|
-
if (".." === p) return "";
|
|
7591
|
-
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
7592
|
-
return match && match[1] || "";
|
|
7593
|
-
};
|
|
7594
|
-
const relative = function(from, to) {
|
|
7595
|
-
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
7596
|
-
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
7597
|
-
if (":" === _to[0][1] && ":" === _from[0][1] && _from[0] !== _to[0]) return _to.join("/");
|
|
7598
|
-
const _fromCopy = [
|
|
7599
|
-
..._from
|
|
7600
|
-
];
|
|
7601
|
-
for (const segment of _fromCopy){
|
|
7602
|
-
if (_to[0] !== segment) break;
|
|
7603
|
-
_from.shift();
|
|
7604
|
-
_to.shift();
|
|
7605
|
-
}
|
|
7606
|
-
return [
|
|
7607
|
-
..._from.map(()=>".."),
|
|
7608
|
-
..._to
|
|
7609
|
-
].join("/");
|
|
7610
|
-
};
|
|
7611
|
-
const dirname = function(p) {
|
|
7612
|
-
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
7613
|
-
if (1 === segments.length && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
|
|
7614
|
-
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
7615
|
-
};
|
|
7616
|
-
const format = function(p) {
|
|
7617
|
-
const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
|
|
7618
|
-
const segments = [
|
|
7619
|
-
p.root,
|
|
7620
|
-
p.dir,
|
|
7621
|
-
p.base ?? (p.name ?? "") + ext
|
|
7622
|
-
].filter(Boolean);
|
|
7623
|
-
return normalizeWindowsPath(p.root ? resolve(...segments) : segments.join("/"));
|
|
7624
|
-
};
|
|
7625
|
-
const basename = function(p, extension) {
|
|
7626
|
-
const segments = normalizeWindowsPath(p).split("/");
|
|
7627
|
-
let lastSegment = "";
|
|
7628
|
-
for(let i = segments.length - 1; i >= 0; i--){
|
|
7629
|
-
const val = segments[i];
|
|
7630
|
-
if (val) {
|
|
7631
|
-
lastSegment = val;
|
|
7632
|
-
break;
|
|
7633
|
-
}
|
|
7634
|
-
}
|
|
7635
|
-
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
7636
|
-
};
|
|
7637
|
-
const parse = function(p) {
|
|
7638
|
-
const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
|
|
7639
|
-
const base = basename(p);
|
|
7640
|
-
const extension = extname(base);
|
|
7641
|
-
return {
|
|
7642
|
-
root,
|
|
7643
|
-
dir: dirname(p),
|
|
7644
|
-
base,
|
|
7645
|
-
ext: extension,
|
|
7646
|
-
name: base.slice(0, base.length - extension.length)
|
|
7647
|
-
};
|
|
7648
|
-
};
|
|
7649
|
-
const matchesGlob = (path, pattern)=>zeptomatch(pattern, normalize(path));
|
|
7650
|
-
const _path = {
|
|
7651
|
-
__proto__: null,
|
|
7652
|
-
basename: basename,
|
|
7653
|
-
dirname: dirname,
|
|
7654
|
-
extname: extname,
|
|
7655
|
-
format: format,
|
|
7656
|
-
isAbsolute: isAbsolute,
|
|
7657
|
-
join: join,
|
|
7658
|
-
matchesGlob: matchesGlob,
|
|
7659
|
-
normalize: normalize,
|
|
7660
|
-
normalizeString: normalizeString,
|
|
7661
|
-
parse: parse,
|
|
7662
|
-
relative: relative,
|
|
7663
|
-
resolve: resolve,
|
|
7664
|
-
sep: sep,
|
|
7665
|
-
toNamespacedPath: toNamespacedPath
|
|
7666
|
-
};
|
|
7667
6627
|
}
|
|
6628
|
+
});
|
|
6629
|
+
const gracefulExit = process.execArgv.some((execArg)=>execArg.startsWith('--perf') || execArg.startsWith('--prof') || execArg.startsWith('--cpu-prof') || execArg.startsWith('--heap-prof') || execArg.startsWith('--diagnostic-dir'));
|
|
6630
|
+
if (gracefulExit) process.on('SIGTERM', ()=>{
|
|
6631
|
+
process.exit();
|
|
6632
|
+
});
|
|
6633
|
+
const build = __webpack_require__("../../node_modules/.pnpm/jest-diff@30.2.0/node_modules/jest-diff/build/index.js");
|
|
6634
|
+
build.DIFF_DELETE;
|
|
6635
|
+
build.DIFF_EQUAL;
|
|
6636
|
+
build.DIFF_INSERT;
|
|
6637
|
+
build.Diff;
|
|
6638
|
+
const diff = build.diff;
|
|
6639
|
+
build.diffLinesRaw;
|
|
6640
|
+
build.diffLinesUnified;
|
|
6641
|
+
build.diffLinesUnified2;
|
|
6642
|
+
build.diffStringsRaw;
|
|
6643
|
+
build.diffStringsUnified;
|
|
6644
|
+
const external_node_util_ = __webpack_require__("node:util");
|
|
6645
|
+
const REAL_TIMERS = {};
|
|
6646
|
+
const setRealTimers = ()=>{
|
|
6647
|
+
REAL_TIMERS.setTimeout ??= globalThis.setTimeout.bind(globalThis);
|
|
7668
6648
|
};
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
a: getter
|
|
7688
|
-
});
|
|
7689
|
-
return getter;
|
|
7690
|
-
};
|
|
7691
|
-
})();
|
|
7692
|
-
(()=>{
|
|
7693
|
-
__webpack_require__.d = (exports, definition)=>{
|
|
7694
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
7695
|
-
enumerable: true,
|
|
7696
|
-
get: definition[key]
|
|
7697
|
-
});
|
|
7698
|
-
};
|
|
7699
|
-
})();
|
|
7700
|
-
(()=>{
|
|
7701
|
-
__webpack_require__.f = {};
|
|
7702
|
-
__webpack_require__.e = (chunkId)=>Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key)=>{
|
|
7703
|
-
__webpack_require__.f[key](chunkId, promises);
|
|
7704
|
-
return promises;
|
|
7705
|
-
}, []));
|
|
7706
|
-
})();
|
|
7707
|
-
(()=>{
|
|
7708
|
-
__webpack_require__.u = (chunkId)=>"0~" + chunkId + ".js";
|
|
7709
|
-
})();
|
|
7710
|
-
(()=>{
|
|
7711
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
7712
|
-
})();
|
|
7713
|
-
(()=>{
|
|
7714
|
-
__webpack_require__.r = (exports)=>{
|
|
7715
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
|
|
7716
|
-
value: 'Module'
|
|
7717
|
-
});
|
|
7718
|
-
Object.defineProperty(exports, '__esModule', {
|
|
7719
|
-
value: true
|
|
6649
|
+
const getRealTimers = ()=>REAL_TIMERS;
|
|
6650
|
+
const formatTestError = (err, test)=>{
|
|
6651
|
+
const errors = Array.isArray(err) ? err : [
|
|
6652
|
+
err
|
|
6653
|
+
];
|
|
6654
|
+
return errors.map((rawError)=>{
|
|
6655
|
+
const error = 'string' == typeof rawError ? {
|
|
6656
|
+
message: rawError
|
|
6657
|
+
} : rawError;
|
|
6658
|
+
const errObj = {
|
|
6659
|
+
...error,
|
|
6660
|
+
message: error.message,
|
|
6661
|
+
name: error.name,
|
|
6662
|
+
stack: error.stack
|
|
6663
|
+
};
|
|
6664
|
+
if (error instanceof TestRegisterError && test?.type === 'case') errObj.message = `Can't nest describe or test inside a test. ${error.message} because it is nested within test '${test.name}'`;
|
|
6665
|
+
if (error.showDiff || void 0 === error.showDiff && void 0 !== error.expected && void 0 !== error.actual) errObj.diff = diff(err.expected, err.actual, {
|
|
6666
|
+
expand: false
|
|
7720
6667
|
});
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
return module;
|
|
7728
|
-
};
|
|
7729
|
-
})();
|
|
7730
|
-
(()=>{
|
|
7731
|
-
var installedChunks = {
|
|
7732
|
-
270: 0
|
|
7733
|
-
};
|
|
7734
|
-
var installChunk = (data)=>{
|
|
7735
|
-
var __webpack_ids__ = data.__webpack_ids__;
|
|
7736
|
-
var __webpack_modules__ = data.__webpack_modules__;
|
|
7737
|
-
var __webpack_runtime__ = data.__webpack_runtime__;
|
|
7738
|
-
var moduleId, chunkId, i = 0;
|
|
7739
|
-
for(moduleId in __webpack_modules__)if (__webpack_require__.o(__webpack_modules__, moduleId)) __webpack_require__.m[moduleId] = __webpack_modules__[moduleId];
|
|
7740
|
-
if (__webpack_runtime__) __webpack_runtime__(__webpack_require__);
|
|
7741
|
-
for(; i < __webpack_ids__.length; i++){
|
|
7742
|
-
chunkId = __webpack_ids__[i];
|
|
7743
|
-
if (__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) installedChunks[chunkId][0]();
|
|
7744
|
-
installedChunks[__webpack_ids__[i]] = 0;
|
|
7745
|
-
}
|
|
7746
|
-
};
|
|
7747
|
-
__webpack_require__.f.j = function(chunkId, promises) {
|
|
7748
|
-
var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : void 0;
|
|
7749
|
-
if (0 !== installedChunkData) if (installedChunkData) promises.push(installedChunkData[1]);
|
|
7750
|
-
else {
|
|
7751
|
-
var promise = import("./" + __webpack_require__.u(chunkId)).then(installChunk, (e)=>{
|
|
7752
|
-
if (0 !== installedChunks[chunkId]) installedChunks[chunkId] = void 0;
|
|
7753
|
-
throw e;
|
|
7754
|
-
});
|
|
7755
|
-
var promise = Promise.race([
|
|
7756
|
-
promise,
|
|
7757
|
-
new Promise((resolve)=>{
|
|
7758
|
-
installedChunkData = installedChunks[chunkId] = [
|
|
7759
|
-
resolve
|
|
7760
|
-
];
|
|
7761
|
-
})
|
|
7762
|
-
]);
|
|
7763
|
-
promises.push(installedChunkData[1] = promise);
|
|
7764
|
-
}
|
|
7765
|
-
};
|
|
7766
|
-
})();
|
|
7767
|
-
__webpack_require__("./src/runtime/worker/setup.ts");
|
|
7768
|
-
var source_map_support = __webpack_require__("../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js");
|
|
7769
|
-
var external_node_module_ = __webpack_require__("node:module");
|
|
7770
|
-
var utils = __webpack_require__("./src/utils/index.ts");
|
|
7771
|
-
const CoverageProviderMap = {
|
|
7772
|
-
istanbul: '@rstest/coverage-istanbul'
|
|
6668
|
+
for (const key of [
|
|
6669
|
+
'actual',
|
|
6670
|
+
'expected'
|
|
6671
|
+
])if ('string' != typeof err[key]) errObj[key] = JSON.stringify(err[key], null, 10);
|
|
6672
|
+
return errObj;
|
|
6673
|
+
});
|
|
7773
6674
|
};
|
|
7774
|
-
const
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
if (
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
const
|
|
7786
|
-
return
|
|
7787
|
-
|
|
7788
|
-
CoverageProvider
|
|
7789
|
-
};
|
|
7790
|
-
} catch {
|
|
7791
|
-
const error = new Error(`Failed to load coverage provider module: ${utils.yW.cyan(moduleName)} in ${utils.yW.underline(root)}, please make sure it is installed.\n`);
|
|
7792
|
-
error.stack = '';
|
|
7793
|
-
throw error;
|
|
7794
|
-
}
|
|
6675
|
+
const formatRegExp = /%[sdjifoOc%]/;
|
|
6676
|
+
const formatName = (template, param, index)=>{
|
|
6677
|
+
let templateStr = template;
|
|
6678
|
+
if ([
|
|
6679
|
+
'%%',
|
|
6680
|
+
'%#',
|
|
6681
|
+
'%$'
|
|
6682
|
+
].some((flag)=>templateStr.includes(flag))) templateStr = templateStr.replace(/%%/g, '__rstest_escaped_%__').replace(/%#/g, `${index}`).replace(/%\$/g, `${index + 1}`).replace(/__rstest_escaped_%__/g, '%%');
|
|
6683
|
+
if (Array.isArray(param)) return formatRegExp.test(templateStr) ? (0, external_node_util_.format)(templateStr, ...param) : templateStr;
|
|
6684
|
+
if (formatRegExp.test(templateStr)) templateStr = (0, external_node_util_.format)(templateStr, param);
|
|
6685
|
+
return templateStr.replace(/\$([$\w.]+)/g, (_, key)=>{
|
|
6686
|
+
const value = getValue(param, key);
|
|
6687
|
+
return value?.toString();
|
|
6688
|
+
});
|
|
7795
6689
|
};
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
6690
|
+
function getValue(source, path, defaultValue) {
|
|
6691
|
+
const paths = path.replace(/\[(\d+)\]/g, '.$1').split('.');
|
|
6692
|
+
let result = source;
|
|
6693
|
+
for (const p of paths){
|
|
6694
|
+
result = result[p];
|
|
6695
|
+
if (void 0 === result) return defaultValue;
|
|
7801
6696
|
}
|
|
7802
|
-
|
|
6697
|
+
return result;
|
|
7803
6698
|
}
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
const
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
}
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
if ("win32" === prop) return win32;
|
|
7819
|
-
return _platforms[prop] || pathe_M_eThtNZ._[prop];
|
|
6699
|
+
class TestRegisterError extends Error {
|
|
6700
|
+
}
|
|
6701
|
+
class RstestError extends Error {
|
|
6702
|
+
fullStack;
|
|
6703
|
+
}
|
|
6704
|
+
function checkPkgInstalled(name) {
|
|
6705
|
+
const require = external_node_module_createRequire(import.meta.url);
|
|
6706
|
+
try {
|
|
6707
|
+
require.resolve(name);
|
|
6708
|
+
} catch (error) {
|
|
6709
|
+
if ('MODULE_NOT_FOUND' === error.code) {
|
|
6710
|
+
const error = new RstestError(`Missing dependency "${name}". Please install it first.`);
|
|
6711
|
+
error.fullStack = true;
|
|
6712
|
+
throw error;
|
|
7820
6713
|
}
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
var logger = __webpack_require__("./src/utils/logger.ts");
|
|
6714
|
+
throw error;
|
|
6715
|
+
}
|
|
6716
|
+
}
|
|
7825
6717
|
const shouldInterop = ({ interopDefault = true, modulePath, mod })=>{
|
|
7826
6718
|
if (!interopDefault) return false;
|
|
7827
6719
|
return !modulePath.endsWith('.mjs') && 'default' in mod;
|
|
@@ -7845,7 +6737,7 @@ function interopModule(mod) {
|
|
|
7845
6737
|
};
|
|
7846
6738
|
}
|
|
7847
6739
|
const asModule = async (something, defaultExport, context, unlinked)=>{
|
|
7848
|
-
const { Module, SyntheticModule } = await import("node:vm");
|
|
6740
|
+
const { Module, SyntheticModule } = await import("./0~535.js").then(__webpack_require__.bind(__webpack_require__, "node:vm?8d7d"));
|
|
7849
6741
|
if (something instanceof Module) return something;
|
|
7850
6742
|
const exports = [
|
|
7851
6743
|
...new Set([
|
|
@@ -7864,13 +6756,14 @@ const asModule = async (something, defaultExport, context, unlinked)=>{
|
|
|
7864
6756
|
await m.evaluate();
|
|
7865
6757
|
return m;
|
|
7866
6758
|
};
|
|
6759
|
+
const external_node_path_ = __webpack_require__("node:path");
|
|
7867
6760
|
const isRelativePath = (p)=>/^\.\.?\//.test(p);
|
|
7868
|
-
const
|
|
6761
|
+
const createRequire = (filename, distPath, rstestContext, assetFiles, interopDefault)=>{
|
|
7869
6762
|
const _require = (()=>{
|
|
7870
6763
|
try {
|
|
7871
|
-
return (
|
|
6764
|
+
return external_node_module_createRequire(filename);
|
|
7872
6765
|
} catch (_err) {
|
|
7873
|
-
return (
|
|
6766
|
+
return external_node_module_createRequire(distPath);
|
|
7874
6767
|
}
|
|
7875
6768
|
})();
|
|
7876
6769
|
const require = (id)=>{
|
|
@@ -7887,7 +6780,7 @@ const worker_createRequire = (filename, distPath, rstestContext, assetFiles, int
|
|
|
7887
6780
|
interopDefault
|
|
7888
6781
|
});
|
|
7889
6782
|
} catch (err) {
|
|
7890
|
-
|
|
6783
|
+
src_logger.error(`load file ${joinedPath} failed:\n`, err instanceof Error ? err.message : err);
|
|
7891
6784
|
}
|
|
7892
6785
|
const resolved = _require.resolve(id);
|
|
7893
6786
|
return _require(resolved);
|
|
@@ -7944,7 +6837,7 @@ const loadModule = ({ codeContent, distPath, testPath, rstestContext, assetFiles
|
|
|
7944
6837
|
const context = {
|
|
7945
6838
|
module: localModule,
|
|
7946
6839
|
exports: localModule.exports,
|
|
7947
|
-
require:
|
|
6840
|
+
require: createRequire(testPath, distPath, rstestContext, assetFiles, interopDefault),
|
|
7948
6841
|
__rstest_dynamic_import__: defineRstestDynamicImport({
|
|
7949
6842
|
testPath,
|
|
7950
6843
|
interopDefault
|
|
@@ -7982,168 +6875,6 @@ const cacheableLoadModule = ({ codeContent, distPath, testPath, rstestContext, a
|
|
|
7982
6875
|
moduleCache.set(testPath, mod);
|
|
7983
6876
|
return mod;
|
|
7984
6877
|
};
|
|
7985
|
-
const TYPE_REQUEST = "q";
|
|
7986
|
-
const TYPE_RESPONSE = "s";
|
|
7987
|
-
const DEFAULT_TIMEOUT = 6e4;
|
|
7988
|
-
function defaultSerialize(i) {
|
|
7989
|
-
return i;
|
|
7990
|
-
}
|
|
7991
|
-
const defaultDeserialize = defaultSerialize;
|
|
7992
|
-
const { clearTimeout: dist_clearTimeout, setTimeout: dist_setTimeout } = globalThis;
|
|
7993
|
-
const random = Math.random.bind(Math);
|
|
7994
|
-
function createBirpc(functions, options) {
|
|
7995
|
-
const { post, on, off = ()=>{}, eventNames = [], serialize = defaultSerialize, deserialize = defaultDeserialize, resolver, bind = "rpc", timeout = DEFAULT_TIMEOUT } = options;
|
|
7996
|
-
const rpcPromiseMap = /* @__PURE__ */ new Map();
|
|
7997
|
-
let _promise;
|
|
7998
|
-
let closed = false;
|
|
7999
|
-
const rpc = new Proxy({}, {
|
|
8000
|
-
get (_, method) {
|
|
8001
|
-
if ("$functions" === method) return functions;
|
|
8002
|
-
if ("$close" === method) return close;
|
|
8003
|
-
if ("$rejectPendingCalls" === method) return rejectPendingCalls;
|
|
8004
|
-
if ("$closed" === method) return closed;
|
|
8005
|
-
if ("then" === method && !eventNames.includes("then") && !("then" in functions)) return;
|
|
8006
|
-
const sendEvent = (...args)=>{
|
|
8007
|
-
post(serialize({
|
|
8008
|
-
m: method,
|
|
8009
|
-
a: args,
|
|
8010
|
-
t: TYPE_REQUEST
|
|
8011
|
-
}));
|
|
8012
|
-
};
|
|
8013
|
-
if (eventNames.includes(method)) {
|
|
8014
|
-
sendEvent.asEvent = sendEvent;
|
|
8015
|
-
return sendEvent;
|
|
8016
|
-
}
|
|
8017
|
-
const sendCall = async (...args)=>{
|
|
8018
|
-
if (closed) throw new Error(`[birpc] rpc is closed, cannot call "${method}"`);
|
|
8019
|
-
if (_promise) try {
|
|
8020
|
-
await _promise;
|
|
8021
|
-
} finally{
|
|
8022
|
-
_promise = void 0;
|
|
8023
|
-
}
|
|
8024
|
-
return new Promise((resolve, reject)=>{
|
|
8025
|
-
const id = nanoid();
|
|
8026
|
-
let timeoutId;
|
|
8027
|
-
if (timeout >= 0) {
|
|
8028
|
-
timeoutId = dist_setTimeout(()=>{
|
|
8029
|
-
try {
|
|
8030
|
-
const handleResult = options.onTimeoutError?.(method, args);
|
|
8031
|
-
if (true !== handleResult) throw new Error(`[birpc] timeout on calling "${method}"`);
|
|
8032
|
-
} catch (e) {
|
|
8033
|
-
reject(e);
|
|
8034
|
-
}
|
|
8035
|
-
rpcPromiseMap.delete(id);
|
|
8036
|
-
}, timeout);
|
|
8037
|
-
if ("object" == typeof timeoutId) timeoutId = timeoutId.unref?.();
|
|
8038
|
-
}
|
|
8039
|
-
rpcPromiseMap.set(id, {
|
|
8040
|
-
resolve,
|
|
8041
|
-
reject,
|
|
8042
|
-
timeoutId,
|
|
8043
|
-
method
|
|
8044
|
-
});
|
|
8045
|
-
post(serialize({
|
|
8046
|
-
m: method,
|
|
8047
|
-
a: args,
|
|
8048
|
-
i: id,
|
|
8049
|
-
t: "q"
|
|
8050
|
-
}));
|
|
8051
|
-
});
|
|
8052
|
-
};
|
|
8053
|
-
sendCall.asEvent = sendEvent;
|
|
8054
|
-
return sendCall;
|
|
8055
|
-
}
|
|
8056
|
-
});
|
|
8057
|
-
function close(customError) {
|
|
8058
|
-
closed = true;
|
|
8059
|
-
rpcPromiseMap.forEach(({ reject, method })=>{
|
|
8060
|
-
const error = new Error(`[birpc] rpc is closed, cannot call "${method}"`);
|
|
8061
|
-
if (customError) {
|
|
8062
|
-
customError.cause ??= error;
|
|
8063
|
-
return reject(customError);
|
|
8064
|
-
}
|
|
8065
|
-
reject(error);
|
|
8066
|
-
});
|
|
8067
|
-
rpcPromiseMap.clear();
|
|
8068
|
-
off(onMessage);
|
|
8069
|
-
}
|
|
8070
|
-
function rejectPendingCalls(handler) {
|
|
8071
|
-
const entries = Array.from(rpcPromiseMap.values());
|
|
8072
|
-
const handlerResults = entries.map(({ method, reject })=>{
|
|
8073
|
-
if (!handler) return reject(new Error(`[birpc]: rejected pending call "${method}".`));
|
|
8074
|
-
return handler({
|
|
8075
|
-
method,
|
|
8076
|
-
reject
|
|
8077
|
-
});
|
|
8078
|
-
});
|
|
8079
|
-
rpcPromiseMap.clear();
|
|
8080
|
-
return handlerResults;
|
|
8081
|
-
}
|
|
8082
|
-
async function onMessage(data, ...extra) {
|
|
8083
|
-
let msg;
|
|
8084
|
-
try {
|
|
8085
|
-
msg = deserialize(data);
|
|
8086
|
-
} catch (e) {
|
|
8087
|
-
if (options.onGeneralError?.(e) !== true) throw e;
|
|
8088
|
-
return;
|
|
8089
|
-
}
|
|
8090
|
-
if (msg.t === TYPE_REQUEST) {
|
|
8091
|
-
const { m: method, a: args } = msg;
|
|
8092
|
-
let result, error;
|
|
8093
|
-
const fn = await (resolver ? resolver(method, functions[method]) : functions[method]);
|
|
8094
|
-
if (fn) try {
|
|
8095
|
-
result = await fn.apply("rpc" === bind ? rpc : functions, args);
|
|
8096
|
-
} catch (e) {
|
|
8097
|
-
error = e;
|
|
8098
|
-
}
|
|
8099
|
-
else error = new Error(`[birpc] function "${method}" not found`);
|
|
8100
|
-
if (msg.i) {
|
|
8101
|
-
if (error && options.onError) options.onError(error, method, args);
|
|
8102
|
-
if (error && options.onFunctionError) {
|
|
8103
|
-
if (true === options.onFunctionError(error, method, args)) return;
|
|
8104
|
-
}
|
|
8105
|
-
if (!error) try {
|
|
8106
|
-
post(serialize({
|
|
8107
|
-
t: TYPE_RESPONSE,
|
|
8108
|
-
i: msg.i,
|
|
8109
|
-
r: result
|
|
8110
|
-
}), ...extra);
|
|
8111
|
-
return;
|
|
8112
|
-
} catch (e) {
|
|
8113
|
-
error = e;
|
|
8114
|
-
if (options.onGeneralError?.(e, method, args) !== true) throw e;
|
|
8115
|
-
}
|
|
8116
|
-
try {
|
|
8117
|
-
post(serialize({
|
|
8118
|
-
t: TYPE_RESPONSE,
|
|
8119
|
-
i: msg.i,
|
|
8120
|
-
e: error
|
|
8121
|
-
}), ...extra);
|
|
8122
|
-
} catch (e) {
|
|
8123
|
-
if (options.onGeneralError?.(e, method, args) !== true) throw e;
|
|
8124
|
-
}
|
|
8125
|
-
}
|
|
8126
|
-
} else {
|
|
8127
|
-
const { i: ack, r: result, e: error } = msg;
|
|
8128
|
-
const promise = rpcPromiseMap.get(ack);
|
|
8129
|
-
if (promise) {
|
|
8130
|
-
dist_clearTimeout(promise.timeoutId);
|
|
8131
|
-
if (error) promise.reject(error);
|
|
8132
|
-
else promise.resolve(result);
|
|
8133
|
-
}
|
|
8134
|
-
rpcPromiseMap.delete(ack);
|
|
8135
|
-
}
|
|
8136
|
-
}
|
|
8137
|
-
_promise = on(onMessage);
|
|
8138
|
-
return rpc;
|
|
8139
|
-
}
|
|
8140
|
-
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
8141
|
-
function nanoid(size = 21) {
|
|
8142
|
-
let id = "";
|
|
8143
|
-
let i = size;
|
|
8144
|
-
while(i--)id += urlAlphabet[64 * random() | 0];
|
|
8145
|
-
return id;
|
|
8146
|
-
}
|
|
8147
6878
|
const processSend = process.send.bind(process);
|
|
8148
6879
|
const processOn = process.on.bind(process);
|
|
8149
6880
|
const processOff = process.off.bind(process);
|
|
@@ -8165,13 +6896,30 @@ function createForksRpcOptions(nodeV8 = node_v8) {
|
|
|
8165
6896
|
}
|
|
8166
6897
|
};
|
|
8167
6898
|
}
|
|
8168
|
-
function createRuntimeRpc(options) {
|
|
8169
|
-
const rpc = createBirpc({},
|
|
6899
|
+
function createRuntimeRpc(options, { originalConsole }) {
|
|
6900
|
+
const rpc = createBirpc({}, {
|
|
6901
|
+
...options,
|
|
6902
|
+
onTimeoutError: (functionName, error)=>{
|
|
6903
|
+
switch(functionName){
|
|
6904
|
+
case 'onTestCaseResult':
|
|
6905
|
+
{
|
|
6906
|
+
const caseResult = error[0];
|
|
6907
|
+
console.error(`[Rstest] timeout on calling "onTestCaseResult" rpc method (Case: "${caseResult.name}", Result: "${caseResult.status}")`);
|
|
6908
|
+
return true;
|
|
6909
|
+
}
|
|
6910
|
+
case 'onConsoleLog':
|
|
6911
|
+
originalConsole.error(`[Rstest] timeout on calling "onConsoleLog" rpc method (Original log: ${error[0].content})`);
|
|
6912
|
+
return true;
|
|
6913
|
+
default:
|
|
6914
|
+
return false;
|
|
6915
|
+
}
|
|
6916
|
+
}
|
|
6917
|
+
});
|
|
8170
6918
|
return {
|
|
8171
6919
|
rpc
|
|
8172
6920
|
};
|
|
8173
6921
|
}
|
|
8174
|
-
|
|
6922
|
+
const external_node_fs_ = __webpack_require__("node:fs");
|
|
8175
6923
|
class NodeSnapshotEnvironment {
|
|
8176
6924
|
constructor(options = {}){
|
|
8177
6925
|
this.options = options;
|
|
@@ -8183,10 +6931,10 @@ class NodeSnapshotEnvironment {
|
|
|
8183
6931
|
return `// Snapshot v${this.getVersion()}`;
|
|
8184
6932
|
}
|
|
8185
6933
|
async resolveRawPath(testPath, rawPath) {
|
|
8186
|
-
return (
|
|
6934
|
+
return isAbsolute(rawPath) ? rawPath : pathe_M_eThtNZ_resolve(dirname(testPath), rawPath);
|
|
8187
6935
|
}
|
|
8188
6936
|
async resolvePath(filepath) {
|
|
8189
|
-
return (
|
|
6937
|
+
return join(join(dirname(filepath), this.options.snapshotsDirName ?? "__snapshots__"), `${basename(filepath)}.snap`);
|
|
8190
6938
|
}
|
|
8191
6939
|
async prepareDirectory(dirPath) {
|
|
8192
6940
|
await external_node_fs_.promises.mkdir(dirPath, {
|
|
@@ -8194,7 +6942,7 @@ class NodeSnapshotEnvironment {
|
|
|
8194
6942
|
});
|
|
8195
6943
|
}
|
|
8196
6944
|
async saveSnapshotFile(filepath, snapshot) {
|
|
8197
|
-
await external_node_fs_.promises.mkdir((
|
|
6945
|
+
await external_node_fs_.promises.mkdir(dirname(filepath), {
|
|
8198
6946
|
recursive: true
|
|
8199
6947
|
});
|
|
8200
6948
|
await external_node_fs_.promises.writeFile(filepath, snapshot, "utf-8");
|
|
@@ -8220,6 +6968,9 @@ class RstestSnapshotEnvironment extends NodeSnapshotEnvironment {
|
|
|
8220
6968
|
return this.resolveSnapshotPath(filepath);
|
|
8221
6969
|
}
|
|
8222
6970
|
}
|
|
6971
|
+
const source_map_support = __webpack_require__("../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js");
|
|
6972
|
+
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
6973
|
+
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
8223
6974
|
let sourceMaps = {};
|
|
8224
6975
|
(0, source_map_support.install)({
|
|
8225
6976
|
retrieveSourceMap: (source)=>{
|
|
@@ -8230,7 +6981,7 @@ let sourceMaps = {};
|
|
|
8230
6981
|
return null;
|
|
8231
6982
|
}
|
|
8232
6983
|
});
|
|
8233
|
-
const registerGlobalApi = (api)=>
|
|
6984
|
+
const registerGlobalApi = (api)=>globalApis.reduce((apis, key)=>{
|
|
8234
6985
|
globalThis[key] = api[key];
|
|
8235
6986
|
return apis;
|
|
8236
6987
|
}, {});
|
|
@@ -8240,15 +6991,20 @@ const setupEnv = (env)=>{
|
|
|
8240
6991
|
if (env) Object.assign(process.env, env);
|
|
8241
6992
|
};
|
|
8242
6993
|
const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot, context })=>{
|
|
8243
|
-
(
|
|
8244
|
-
context.runtimeConfig = (
|
|
6994
|
+
setRealTimers();
|
|
6995
|
+
context.runtimeConfig = undoSerializableConfig(context.runtimeConfig);
|
|
8245
6996
|
process.env.RSTEST_WORKER_ID = String(process.__tinypool_state__.workerId || context.taskId);
|
|
8246
6997
|
const cleanupFns = [];
|
|
8247
|
-
const
|
|
6998
|
+
const originalConsole = global.console;
|
|
6999
|
+
const { rpc } = createRuntimeRpc(createForksRpcOptions(), {
|
|
7000
|
+
originalConsole
|
|
7001
|
+
});
|
|
8248
7002
|
const { runtimeConfig: { globals, printConsoleTrace, disableConsoleIntercept, testEnvironment, snapshotFormat, env } } = context;
|
|
8249
7003
|
setupEnv(env);
|
|
8250
7004
|
if (!disableConsoleIntercept) {
|
|
8251
|
-
const { createCustomConsole } = await
|
|
7005
|
+
const { createCustomConsole } = await import("./0~607.js").then((mod)=>({
|
|
7006
|
+
createCustomConsole: mod.createCustomConsole
|
|
7007
|
+
}));
|
|
8252
7008
|
global.console = createCustomConsole({
|
|
8253
7009
|
rpc,
|
|
8254
7010
|
testPath,
|
|
@@ -8269,10 +7025,9 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot,
|
|
|
8269
7025
|
testPath,
|
|
8270
7026
|
environment: 'node'
|
|
8271
7027
|
};
|
|
8272
|
-
const { createRstestRuntime } = await
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
]).then(__webpack_require__.bind(__webpack_require__, "./src/runtime/api/index.ts"));
|
|
7028
|
+
const { createRstestRuntime } = await import("./0~764.js").then((mod)=>({
|
|
7029
|
+
createRstestRuntime: mod.createRstestRuntime
|
|
7030
|
+
}));
|
|
8276
7031
|
listeners.forEach((fn)=>{
|
|
8277
7032
|
fn();
|
|
8278
7033
|
});
|
|
@@ -8282,7 +7037,7 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot,
|
|
|
8282
7037
|
const error = 'string' == typeof e ? new Error(e) : e;
|
|
8283
7038
|
error.name = type;
|
|
8284
7039
|
if (isTeardown) {
|
|
8285
|
-
error.stack = `${
|
|
7040
|
+
error.stack = `${picocolors_default().yellow('Caught error after test environment was torn down:')}\n\n${error.stack}`;
|
|
8286
7041
|
console.error(error);
|
|
8287
7042
|
} else {
|
|
8288
7043
|
console.error(error);
|
|
@@ -8303,14 +7058,18 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot,
|
|
|
8303
7058
|
break;
|
|
8304
7059
|
case 'jsdom':
|
|
8305
7060
|
{
|
|
8306
|
-
const { environment } = await
|
|
7061
|
+
const { environment } = await import("./0~711.js").then((mod)=>({
|
|
7062
|
+
environment: mod.environment
|
|
7063
|
+
}));
|
|
8307
7064
|
const { teardown } = await environment.setup(global, {});
|
|
8308
7065
|
cleanupFns.push(()=>teardown(global));
|
|
8309
7066
|
break;
|
|
8310
7067
|
}
|
|
8311
7068
|
case 'happy-dom':
|
|
8312
7069
|
{
|
|
8313
|
-
const { environment } = await
|
|
7070
|
+
const { environment } = await import("./0~350.js").then((mod)=>({
|
|
7071
|
+
environment: mod.environment
|
|
7072
|
+
}));
|
|
8314
7073
|
const { teardown } = await environment.setup(global, {});
|
|
8315
7074
|
cleanupFns.push(async ()=>teardown(global));
|
|
8316
7075
|
break;
|
|
@@ -8379,12 +7138,18 @@ const runInPool = async (options)=>{
|
|
|
8379
7138
|
process.exit = (code = process.exitCode || 0)=>{
|
|
8380
7139
|
throw new Error(`process.exit unexpectedly called with "${code}"`);
|
|
8381
7140
|
};
|
|
7141
|
+
const kill = process.kill.bind(process);
|
|
7142
|
+
process.kill = (pid, signal)=>{
|
|
7143
|
+
if (-1 === pid || Math.abs(pid) === process.pid) throw new Error(`process.kill unexpectedly called with "${pid}" and "${signal}"`);
|
|
7144
|
+
return kill(pid, signal);
|
|
7145
|
+
};
|
|
8382
7146
|
cleanups.push(()=>{
|
|
7147
|
+
process.kill = kill;
|
|
8383
7148
|
process.exit = exit;
|
|
8384
7149
|
});
|
|
8385
7150
|
process.off('SIGTERM', onExit);
|
|
8386
7151
|
const teardown = async ()=>{
|
|
8387
|
-
await new Promise((resolve)=>(
|
|
7152
|
+
await new Promise((resolve)=>getRealTimers().setTimeout(resolve));
|
|
8388
7153
|
await Promise.all(cleanups.map((fn)=>fn()));
|
|
8389
7154
|
isTeardown = true;
|
|
8390
7155
|
process.once('SIGTERM', onExit);
|
|
@@ -8408,14 +7173,14 @@ const runInPool = async (options)=>{
|
|
|
8408
7173
|
project,
|
|
8409
7174
|
testPath,
|
|
8410
7175
|
tests,
|
|
8411
|
-
errors: (
|
|
7176
|
+
errors: formatTestError(unhandledErrors)
|
|
8412
7177
|
};
|
|
8413
7178
|
} catch (err) {
|
|
8414
7179
|
return {
|
|
8415
7180
|
project,
|
|
8416
7181
|
testPath,
|
|
8417
7182
|
tests: [],
|
|
8418
|
-
errors: (
|
|
7183
|
+
errors: formatTestError(err)
|
|
8419
7184
|
};
|
|
8420
7185
|
} finally{
|
|
8421
7186
|
await teardown();
|
|
@@ -8446,7 +7211,7 @@ const runInPool = async (options)=>{
|
|
|
8446
7211
|
}, api);
|
|
8447
7212
|
if (unhandledErrors.length > 0) {
|
|
8448
7213
|
results.status = 'fail';
|
|
8449
|
-
results.errors = (results.errors || []).concat(...(
|
|
7214
|
+
results.errors = (results.errors || []).concat(...formatTestError(unhandledErrors));
|
|
8450
7215
|
}
|
|
8451
7216
|
if (coverageProvider) {
|
|
8452
7217
|
const coverageMap = coverageProvider.collect();
|
|
@@ -8461,11 +7226,12 @@ const runInPool = async (options)=>{
|
|
|
8461
7226
|
status: 'fail',
|
|
8462
7227
|
name: '',
|
|
8463
7228
|
results: [],
|
|
8464
|
-
errors: (
|
|
7229
|
+
errors: formatTestError(err)
|
|
8465
7230
|
};
|
|
8466
7231
|
} finally{
|
|
8467
7232
|
await teardown();
|
|
8468
7233
|
}
|
|
8469
7234
|
};
|
|
8470
7235
|
const worker = runInPool;
|
|
8471
|
-
export
|
|
7236
|
+
export default worker;
|
|
7237
|
+
export { TestRegisterError, checkPkgInstalled, formatName, formatTestError, getRealTimers };
|