@rstest/core 0.9.1 → 0.9.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.
Files changed (48) hide show
  1. package/dist/{0~89.js → 0~8843.js} +20 -24
  2. package/dist/{0~1472.js → 0~browserLoader.js} +5 -5
  3. package/dist/{0~7882.js → 0~browser~1.js} +32 -33
  4. package/dist/{0~8426.js → 0~checkThresholds.js} +2 -2
  5. package/dist/{0~130.js → 0~console.js} +15 -16
  6. package/dist/{0~9744.js → 0~dist.js} +57 -57
  7. package/dist/{0~7583.js → 0~esm.js} +66 -68
  8. package/dist/{0~4403.js → 0~generate.js} +5 -6
  9. package/dist/{0~4809.js → 0~happyDom.js} +2 -2
  10. package/dist/{0~3346.js → 0~interop.js} +0 -1
  11. package/dist/{0~62.js → 0~jsdom.js} +2 -2
  12. package/dist/{0~262.js → 0~lib.js} +4 -1
  13. package/dist/{0~9634.js → 0~listTests.js} +14 -23
  14. package/dist/{0~6923.js → 0~loadEsModule.js} +7 -7
  15. package/dist/{0~5835.js → 0~loadModule.js} +11 -11
  16. package/dist/{0~6907.js → 0~magic-string.es.js} +2 -1
  17. package/dist/{0~2255.js → 0~plugin.js} +2 -4
  18. package/dist/{0~6588.js → 0~restart.js} +7 -11
  19. package/dist/{0~2173.js → 0~runTests.js} +11 -20
  20. package/dist/{487.js → 1255.js} +22 -15
  21. package/dist/{6151.js → 1949.js} +15 -15
  22. package/dist/{6973.js → 255.js} +7 -8
  23. package/dist/{9131.js → 3145.js} +75 -404
  24. package/dist/{1157.js → 4411.js} +35 -35
  25. package/dist/{4484.js → 5040.js} +1 -2
  26. package/dist/{3160.js → 6830.js} +389 -81
  27. package/dist/7011.js +1 -1
  28. package/dist/{1294.js → 7552.js} +28 -22
  29. package/dist/{5734.js → 7704.js} +6 -5
  30. package/dist/browser-runtime/{2~907.js → 2~magic-string.es.js} +18 -11
  31. package/dist/browser-runtime/{389.js → 723.js} +39 -44
  32. package/dist/browser-runtime/{389.js.LICENSE.txt → 723.js.LICENSE.txt} +0 -22
  33. package/dist/browser-runtime/index.js +1 -1
  34. package/dist/browser-runtime/rslib-runtime.js +11 -3
  35. package/dist/browser.js +9 -7
  36. package/dist/globalSetupWorker.js +4 -13
  37. package/dist/index.js +2 -2
  38. package/dist/rslib-runtime.js +5 -8
  39. package/dist/worker.js +19 -45
  40. package/package.json +6 -6
  41. package/dist/3160.js.LICENSE.txt +0 -21
  42. package/dist/4881.js +0 -2
  43. package/dist/6198.js +0 -2
  44. /package/dist/{0~7583.js.LICENSE.txt → 0~esm.js.LICENSE.txt} +0 -0
  45. /package/dist/{0~3062.js → 0~utils.js} +0 -0
  46. /package/dist/{6151.js.LICENSE.txt → 1949.js.LICENSE.txt} +0 -0
  47. /package/dist/{4597.js → 1983.js} +0 -0
  48. /package/dist/{1294.js.LICENSE.txt → 7552.js.LICENSE.txt} +0 -0
@@ -1,5 +1,12 @@
1
1
  import { __webpack_require__ } from "./rslib-runtime.js";
2
- import "./389.js";
2
+ import "./723.js";
3
+ var magic_string_es_namespaceObject = {};
4
+ __webpack_require__.r(magic_string_es_namespaceObject);
5
+ __webpack_require__.d(magic_string_es_namespaceObject, {
6
+ Bundle: ()=>Bundle,
7
+ SourceMap: ()=>SourceMap,
8
+ default: ()=>MagicString
9
+ });
3
10
  var Buffer = __webpack_require__("../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.js")["Buffer"];
4
11
  var comma = ",".charCodeAt(0);
5
12
  var semicolon = ";".charCodeAt(0);
@@ -19,7 +26,7 @@ function encodeInteger(builder, num, relative) {
19
26
  delta >>>= 5;
20
27
  if (delta > 0) clamped |= 32;
21
28
  builder.write(intToChar[clamped]);
22
- }while (delta > 0);
29
+ }while (delta > 0)
23
30
  return num;
24
31
  }
25
32
  var bufLength = 16384;
@@ -796,7 +803,7 @@ class MagicString {
796
803
  if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
797
804
  if (chunk.content.length) return chunk.content[chunk.content.length - 1];
798
805
  if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
799
- }while (chunk = chunk.previous);
806
+ }while (chunk = chunk.previous)
800
807
  if (this.intro.length) return this.intro[this.intro.length - 1];
801
808
  return '';
802
809
  }
@@ -821,7 +828,7 @@ class MagicString {
821
828
  if (-1 !== lineIndex) return chunk.intro.substr(lineIndex + 1) + lineStr;
822
829
  lineStr = chunk.intro + lineStr;
823
830
  }
824
- }while (chunk = chunk.previous);
831
+ }while (chunk = chunk.previous)
825
832
  lineIndex = this.intro.lastIndexOf(magic_string_es_n);
826
833
  if (-1 !== lineIndex) return this.intro.substr(lineIndex + 1) + lineStr;
827
834
  return this.intro + lineStr;
@@ -897,14 +904,14 @@ class MagicString {
897
904
  isEmpty() {
898
905
  let chunk = this.firstChunk;
899
906
  do if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim()) return false;
900
- while (chunk = chunk.next);
907
+ while (chunk = chunk.next)
901
908
  return true;
902
909
  }
903
910
  length() {
904
911
  let chunk = this.firstChunk;
905
912
  let length = 0;
906
913
  do length += chunk.intro.length + chunk.content.length + chunk.outro.length;
907
- while (chunk = chunk.next);
914
+ while (chunk = chunk.next)
908
915
  return length;
909
916
  }
910
917
  trimLines() {
@@ -929,7 +936,7 @@ class MagicString {
929
936
  }
930
937
  if (aborted) return true;
931
938
  chunk = chunk.previous;
932
- }while (chunk);
939
+ }while (chunk)
933
940
  return false;
934
941
  }
935
942
  trimEnd(charType) {
@@ -952,7 +959,7 @@ class MagicString {
952
959
  }
953
960
  if (aborted) return true;
954
961
  chunk = chunk.next;
955
- }while (chunk);
962
+ }while (chunk)
956
963
  return false;
957
964
  }
958
965
  trimStart(charType) {
@@ -1188,7 +1195,7 @@ class Bundle {
1188
1195
  do {
1189
1196
  source = this.sources[i++];
1190
1197
  if (!source) break;
1191
- }while (!source.content.trimStartAborted(charType));
1198
+ }while (!source.content.trimStartAborted(charType))
1192
1199
  }
1193
1200
  return this;
1194
1201
  }
@@ -1202,8 +1209,8 @@ class Bundle {
1202
1209
  this.intro = this.intro.replace(rx, '');
1203
1210
  break;
1204
1211
  }
1205
- }while (!source.content.trimEndAborted(charType));
1212
+ }while (!source.content.trimEndAborted(charType))
1206
1213
  return this;
1207
1214
  }
1208
1215
  }
1209
- export { Bundle, MagicString, SourceMap };
1216
+ export { magic_string_es_namespaceObject };
@@ -1,4 +1,4 @@
1
- /*! For license information please see 389.js.LICENSE.txt */
1
+ /*! LICENSE: 723.js.LICENSE.txt */
2
2
  import { __webpack_require__ } from "./rslib-runtime.js";
3
3
  __webpack_require__.add({
4
4
  "../../node_modules/.pnpm/@jest+diff-sequences@30.0.1/node_modules/@jest/diff-sequences/build/index.js" (module) {
@@ -1655,9 +1655,9 @@ __webpack_require__.add({
1655
1655
  };
1656
1656
  }
1657
1657
  const defaultImplementation = withGlobal(globalObject);
1658
- defaultImplementation.timers;
1659
- defaultImplementation.createClock;
1660
- defaultImplementation.install;
1658
+ exports.timers = defaultImplementation.timers;
1659
+ exports.createClock = defaultImplementation.createClock;
1660
+ exports.install = defaultImplementation.install;
1661
1661
  exports.withGlobal = withGlobal;
1662
1662
  },
1663
1663
  "../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js" (module, __unused_rspack_exports, __webpack_require__) {
@@ -1914,8 +1914,7 @@ __webpack_require__.add({
1914
1914
  get: assembleStyles
1915
1915
  });
1916
1916
  },
1917
- "../../node_modules/.pnpm/ansi-styles@5.2.0/node_modules/ansi-styles/index.js" (module, exports, __webpack_require__) {
1918
- __webpack_require__.r(exports);
1917
+ "../../node_modules/.pnpm/ansi-styles@5.2.0/node_modules/ansi-styles/index.js" (module, __unused_rspack_exports, __webpack_require__) {
1919
1918
  module = __webpack_require__.nmd(module);
1920
1919
  const ANSI_BACKGROUND_OFFSET = 10;
1921
1920
  const wrapAnsi256 = (offset = 0)=>(code)=>`\u001B[${38 + offset};5;${code}m`;
@@ -3693,7 +3692,7 @@ __webpack_require__.add({
3693
3692
  returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
3694
3693
  endIndex = index + substringLength;
3695
3694
  index = string.indexOf(substring, endIndex);
3696
- }while (-1 !== index);
3695
+ }while (-1 !== index)
3697
3696
  returnValue += string.substr(endIndex);
3698
3697
  return returnValue;
3699
3698
  };
@@ -3705,7 +3704,7 @@ __webpack_require__.add({
3705
3704
  returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
3706
3705
  endIndex = index + 1;
3707
3706
  index = string.indexOf('\n', endIndex);
3708
- }while (-1 !== index);
3707
+ }while (-1 !== index)
3709
3708
  returnValue += string.substr(endIndex);
3710
3709
  return returnValue;
3711
3710
  };
@@ -7615,7 +7614,7 @@ __webpack_require__.add({
7615
7614
  exports.test = exports.serialize = exports["default"] = void 0;
7616
7615
  var _collections = __nested_rspack_require_5506_5525__("./src/collections.ts");
7617
7616
  var Symbol1 = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol;
7618
- const asymmetricMatcher = 'function' == typeof Symbol1 && Symbol1.for ? Symbol1.for('jest.asymmetricMatcher') : 0x1357a5;
7617
+ const asymmetricMatcher = 'function' == typeof Symbol1 && Symbol1.for ? Symbol1.for('jest.asymmetricMatcher') : 0x13_57_a5;
7619
7618
  const SPACE = ' ';
7620
7619
  const serialize = (val, config, indentation, depth, refs, printer)=>{
7621
7620
  const stringedValue = val.toString();
@@ -7879,7 +7878,7 @@ __webpack_require__.add({
7879
7878
  exports.test = exports.serialize = exports["default"] = void 0;
7880
7879
  var _markup = __nested_rspack_require_20800_20819__("./src/plugins/lib/markup.ts");
7881
7880
  var Symbol1 = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol;
7882
- const testSymbol = 'function' == typeof Symbol1 && Symbol1.for ? Symbol1.for('react.test.json') : 0xea71357;
7881
+ const testSymbol = 'function' == typeof Symbol1 && Symbol1.for ? Symbol1.for('react.test.json') : 0xe_a7_13_57;
7883
7882
  const getPropKeys = (object)=>{
7884
7883
  const { props } = object;
7885
7884
  return props ? Object.keys(props).filter((key)=>void 0 !== props[key]).sort() : [];
@@ -9815,7 +9814,7 @@ function chunk_BVHSVHOK_p(n = !1) {
9815
9814
  let e = chunk_BVHSVHOK_C(n), i = (r, t, c, o)=>{
9816
9815
  let l = "", s = 0;
9817
9816
  do l += r.substring(s, o) + c, s = o + t.length, o = r.indexOf(t, s);
9818
- while (~o);
9817
+ while (~o)
9819
9818
  return l + r.substring(s);
9820
9819
  }, g = (r, t, c = r)=>{
9821
9820
  let o = (l)=>{
@@ -17877,11 +17876,11 @@ const JestExtend = (chai, utils)=>{
17877
17876
  use(JestExtendPlugin(chai, expect, expects));
17878
17877
  });
17879
17878
  };
17880
- const util_0 = __webpack_require__("../../node_modules/.pnpm/util@0.12.5/node_modules/util/util.js");
17881
- const browser = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
17882
- const browser_0 = __webpack_require__("../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js");
17879
+ const util_util = __webpack_require__("../../node_modules/.pnpm/util@0.12.5/node_modules/util/util.js");
17880
+ const process_browser = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
17881
+ const browser = __webpack_require__("../../node_modules/.pnpm/os-browserify@0.3.0/node_modules/os-browserify/browser.js");
17883
17882
  const tty_browserify = __webpack_require__("../../node_modules/.pnpm/tty-browserify@0.0.1/node_modules/tty-browserify/index.js");
17884
- const createStyler = (style)=>(text)=>(0, util_0.styleText)(style, String(text));
17883
+ const createStyler = (style)=>(text)=>(0, util_util.styleText)(style, String(text));
17885
17884
  const bold = createStyler('bold');
17886
17885
  const red = createStyler('red');
17887
17886
  const green = createStyler('green');
@@ -17889,13 +17888,13 @@ const yellow = createStyler('yellow');
17889
17888
  const magenta = createStyler('magenta');
17890
17889
  const cyan = createStyler('cyan');
17891
17890
  const gray = createStyler('gray');
17892
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : browser.argv) {
17891
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process_browser.argv) {
17893
17892
  const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
17894
17893
  const position = argv.indexOf(prefix + flag);
17895
17894
  const terminatorPosition = argv.indexOf('--');
17896
17895
  return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
17897
17896
  }
17898
- const { env: env } = browser;
17897
+ const { env: env } = process_browser;
17899
17898
  let flagForceColor;
17900
17899
  if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) flagForceColor = 0;
17901
17900
  else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
@@ -17935,8 +17934,8 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
17935
17934
  if (haveStream && !streamIsTTY && void 0 === forceColor) return 0;
17936
17935
  const min = forceColor || 0;
17937
17936
  if ('dumb' === env.TERM) return min;
17938
- if ('win32' === browser.platform) {
17939
- const osRelease = browser_0.release().split('.');
17937
+ if ('win32' === process_browser.platform) {
17938
+ const osRelease = browser.release().split('.');
17940
17939
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
17941
17940
  return 1;
17942
17941
  }
@@ -21169,22 +21168,22 @@ function chai_use(fn) {
21169
21168
  return exports;
21170
21169
  }
21171
21170
  chai_name(chai_use, "use");
21172
- const build_0 = __webpack_require__("../../node_modules/.pnpm/jest-diff@30.2.0/node_modules/jest-diff/build/index.js");
21173
- build_0.DIFF_DELETE;
21174
- build_0.DIFF_EQUAL;
21175
- build_0.DIFF_INSERT;
21176
- build_0.Diff;
21177
- const build_diff = build_0.diff;
21178
- build_0.diffLinesRaw;
21179
- build_0.diffLinesUnified;
21180
- build_0.diffLinesUnified2;
21181
- build_0.diffStringsRaw;
21182
- build_0.diffStringsUnified;
21183
- const build_1 = __webpack_require__("../../node_modules/.pnpm/pretty-format@30.2.0/node_modules/pretty-format/build/index.js");
21184
- build_1.DEFAULT_OPTIONS;
21185
- const build_format = build_1.format;
21186
- const build_plugins = build_1.plugins;
21187
- build_1["default"];
21171
+ const jest_diff_build = __webpack_require__("../../node_modules/.pnpm/jest-diff@30.2.0/node_modules/jest-diff/build/index.js");
21172
+ jest_diff_build.DIFF_DELETE;
21173
+ jest_diff_build.DIFF_EQUAL;
21174
+ jest_diff_build.DIFF_INSERT;
21175
+ jest_diff_build.Diff;
21176
+ const build_diff = jest_diff_build.diff;
21177
+ jest_diff_build.diffLinesRaw;
21178
+ jest_diff_build.diffLinesUnified;
21179
+ jest_diff_build.diffLinesUnified2;
21180
+ jest_diff_build.diffStringsRaw;
21181
+ jest_diff_build.diffStringsUnified;
21182
+ const pretty_format_build_0 = __webpack_require__("../../node_modules/.pnpm/pretty-format@30.2.0/node_modules/pretty-format/build/index.js");
21183
+ pretty_format_build_0.DEFAULT_OPTIONS;
21184
+ const build_format = pretty_format_build_0.format;
21185
+ const build_plugins = pretty_format_build_0.plugins;
21186
+ pretty_format_build_0["default"];
21188
21187
  __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
21189
21188
  const REAL_TIMERS = {};
21190
21189
  const setRealTimers = ()=>{
@@ -21495,7 +21494,7 @@ function decodeInteger(reader, relative) {
21495
21494
  integer = charToInt[c];
21496
21495
  value |= (31 & integer) << shift;
21497
21496
  shift += 5;
21498
- }while (32 & integer);
21497
+ }while (32 & integer)
21499
21498
  const shouldNegate = 1 & value;
21500
21499
  value >>>= 1;
21501
21500
  if (shouldNegate) value = -2147483648 | -value;
@@ -21570,7 +21569,7 @@ function decode(mappings) {
21570
21569
  if (!sorted) sort(line);
21571
21570
  decoded.push(line);
21572
21571
  reader.pos = semi + 1;
21573
- }while (reader.pos <= length);
21572
+ }while (reader.pos <= length)
21574
21573
  return decoded;
21575
21574
  }
21576
21575
  function sort(line) {
@@ -22692,7 +22691,7 @@ function dist_p(n = false) {
22692
22691
  let e = dist_C(n), i = (r, t, c, o)=>{
22693
22692
  let l = "", s = 0;
22694
22693
  do l += r.substring(s, o) + c, s = o + t.length, o = r.indexOf(t, s);
22695
- while (~o);
22694
+ while (~o)
22696
22695
  return l + r.substring(s);
22697
22696
  }, g = (r, t, c = r)=>{
22698
22697
  let o = (l)=>{
@@ -22730,11 +22729,7 @@ function offsetToLineNumber(source, offset) {
22730
22729
  return line + 1;
22731
22730
  }
22732
22731
  async function saveInlineSnapshots(environment, snapshots) {
22733
- const MagicString = (await import("./2~907.js").then((mod)=>({
22734
- Bundle: mod.Bundle,
22735
- SourceMap: mod.SourceMap,
22736
- default: mod.MagicString
22737
- }))).default;
22732
+ const MagicString = (await import("./2~magic-string.es.js").then((m)=>m.magic_string_es_namespaceObject)).default;
22738
22733
  const files = new Set(snapshots.map((i)=>i.file));
22739
22734
  await Promise.all(Array.from(files).map(async (file)=>{
22740
22735
  const snaps = snapshots.filter((i)=>i.file === file);
@@ -24226,7 +24221,7 @@ class TestRunner {
24226
24221
  errors: 'fail' === currentResult.status && result && result.errors ? result.errors.concat(...currentResult.errors || []) : currentResult.errors
24227
24222
  };
24228
24223
  retryCount++;
24229
- }while (retryCount <= retry && 'fail' === result.status);
24224
+ }while (retryCount <= retry && 'fail' === result.status)
24230
24225
  result.duration = RealDate.now() - start;
24231
24226
  result.retryCount = retryCount - 1;
24232
24227
  result.heap = state.runtimeConfig.logHeapUsage ? runner_process.memoryUsage().heapUsed : void 0;
@@ -135,28 +135,6 @@
135
135
  * MIT Licensed
136
136
  */
137
137
 
138
- /*!
139
- * Copyright 2017 Vercel, Inc.
140
- *
141
- * This file is derived from Vercel's detect-agent:
142
- * https://github.com/vercel/vercel/tree/main/packages/detect-agent
143
- *
144
- * Licensed under the Apache License, Version 2.0 (the "License");
145
- * you may not use this file except in compliance with the License.
146
- * You may obtain a copy of the License at
147
- *
148
- * http://www.apache.org/licenses/LICENSE-2.0
149
- *
150
- * Unless required by applicable law or agreed to in writing, software
151
- * distributed under the License is distributed on an "AS IS" BASIS,
152
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
153
- * See the License for the specific language governing permissions and
154
- * limitations under the License.
155
- *
156
- * Modifications in this derived work:
157
- * - Removed async determine logic, kept only env detection.
158
- */
159
-
160
138
  /*!
161
139
  * The buffer module from node.js, for the browser.
162
140
  *
@@ -1 +1 @@
1
- export { afterAll, afterEach, assert, beforeAll, beforeEach, createRstestRuntime, describe, expect, globalApis, it, onTestFailed, onTestFinished, rs, rstest, setRealTimers, test } from "./389.js";
1
+ export { afterAll, afterEach, assert, beforeAll, beforeEach, createRstestRuntime, describe, expect, globalApis, it, onTestFailed, onTestFinished, rs, rstest, setRealTimers, test } from "./723.js";
@@ -4,15 +4,20 @@ function __webpack_require__(moduleId) {
4
4
  var cachedModule = __webpack_module_cache__[moduleId];
5
5
  if (void 0 !== cachedModule) return cachedModule.exports;
6
6
  var module = __webpack_module_cache__[moduleId] = {
7
- id: moduleId,
8
- loaded: false,
9
7
  exports: {}
10
8
  };
11
9
  __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
12
- module.loaded = true;
13
10
  return module.exports;
14
11
  }
15
12
  __webpack_require__.m = __webpack_modules__;
13
+ (()=>{
14
+ __webpack_require__.d = (exports, definition)=>{
15
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
16
+ enumerable: true,
17
+ get: definition[key]
18
+ });
19
+ };
20
+ })();
16
21
  (()=>{
17
22
  __webpack_require__.add = function registerModules(modules) {
18
23
  Object.assign(__webpack_require__.m, modules);
@@ -28,6 +33,9 @@ __webpack_require__.m = __webpack_modules__;
28
33
  }
29
34
  })();
30
35
  })();
36
+ (()=>{
37
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
38
+ })();
31
39
  (()=>{
32
40
  __webpack_require__.r = (exports)=>{
33
41
  if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
package/dist/browser.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import "node:module";
2
- export { TEMP_RSTEST_OUTPUT_DIR, getTestEntries, globalApis } from "./1157.js";
3
- export { afterAll, afterEach, assert, beforeAll, beforeEach, describe, expect, it, onTestFailed, onTestFinished, rs, rsbuild, rstest, test } from "./4484.js";
4
- export { color, isDebug, logger, serializableConfig } from "./3160.js";
5
- export { createRstestRuntime } from "./6151.js";
6
- export { getSetupFiles } from "./6973.js";
7
- export { loadCoverageProvider } from "./5734.js";
8
- export { setRealTimers } from "./1294.js";
2
+ import * as __rspack_external__rsbuild_core_1b356efc from "@rsbuild/core";
3
+ export { TEMP_RSTEST_OUTPUT_DIR, getTestEntries, globalApis } from "./4411.js";
4
+ export { afterAll, afterEach, assert, beforeAll, beforeEach, describe, expect, it, onTestFailed, onTestFinished, rs, rstest, test } from "./5040.js";
5
+ export { color, isDebug, logger, serializableConfig } from "./6830.js";
6
+ export { createRstestRuntime } from "./1949.js";
7
+ export { getSetupFiles } from "./255.js";
8
+ export { loadCoverageProvider } from "./7704.js";
9
+ export { setRealTimers } from "./7552.js";
10
+ export { __rspack_external__rsbuild_core_1b356efc as rsbuild };
@@ -1,8 +1,8 @@
1
1
  import "node:module";
2
2
  import { __webpack_require__ } from "./rslib-runtime.js";
3
- import "./487.js";
4
- import { color } from "./3160.js";
5
- import { formatTestError } from "./1294.js";
3
+ import "./1255.js";
4
+ import { color } from "./6830.js";
5
+ import { formatTestError } from "./7552.js";
6
6
  const source_map_support = __webpack_require__("../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js");
7
7
  let teardownCallbacks = [];
8
8
  let initialEnv = {};
@@ -39,16 +39,7 @@ const runGlobalSetup = async (data)=>{
39
39
  for (const entry of data.entries){
40
40
  const { distPath, testPath } = entry;
41
41
  const setupCodeContent = data.assetFiles[distPath];
42
- const { loadModule } = data.outputModule ? await import("./0~6923.js").then((mod)=>({
43
- EsmMode: mod.loadEsModule_EsmMode,
44
- asModule: mod.asModule,
45
- clearModuleCache: mod.clearModuleCache,
46
- loadModule: mod.loadModule
47
- })) : await import("./0~5835.js").then((mod)=>({
48
- cacheableLoadModule: mod.cacheableLoadModule,
49
- clearModuleCache: mod.clearModuleCache,
50
- loadModule: mod.loadModule
51
- }));
42
+ const { loadModule } = data.outputModule ? await import("./0~loadEsModule.js") : await import("./0~loadModule.js");
52
43
  const module = await loadModule({
53
44
  codeContent: setupCodeContent,
54
45
  distPath,
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import "node:module";
2
- export { afterAll, afterEach, assert, beforeAll, beforeEach, describe, expect, it, onTestFailed, onTestFinished, rs, rstest, test } from "./4484.js";
3
- export { createRstest, defineConfig, defineProject, initCli, loadConfig, mergeProjectConfig, mergeRstestConfig, runCLI } from "./9131.js";
2
+ export { afterAll, afterEach, assert, beforeAll, beforeEach, describe, expect, it, onTestFailed, onTestFinished, rs, rstest, test } from "./5040.js";
3
+ export { createRstest, defineConfig, defineProject, initCli, loadConfig, mergeProjectConfig, mergeRstestConfig, runCLI } from "./3145.js";
@@ -5,20 +5,12 @@ function __webpack_require__(moduleId) {
5
5
  var cachedModule = __webpack_module_cache__[moduleId];
6
6
  if (void 0 !== cachedModule) return cachedModule.exports;
7
7
  var module = __webpack_module_cache__[moduleId] = {
8
- id: moduleId,
9
- loaded: false,
10
8
  exports: {}
11
9
  };
12
10
  __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
13
- module.loaded = true;
14
11
  return module.exports;
15
12
  }
16
13
  __webpack_require__.m = __webpack_modules__;
17
- (()=>{
18
- __webpack_require__.add = function registerModules(modules) {
19
- Object.assign(__webpack_require__.m, modules);
20
- };
21
- })();
22
14
  (()=>{
23
15
  __webpack_require__.n = (module)=>{
24
16
  var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
@@ -36,6 +28,11 @@ __webpack_require__.m = __webpack_modules__;
36
28
  });
37
29
  };
38
30
  })();
31
+ (()=>{
32
+ __webpack_require__.add = function registerModules(modules) {
33
+ Object.assign(__webpack_require__.m, modules);
34
+ };
35
+ })();
39
36
  (()=>{
40
37
  __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
41
38
  })();
package/dist/worker.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import "node:module";
2
2
  import { __webpack_require__ } from "./rslib-runtime.js";
3
- import { basename, isAbsolute, color, dirname, resolve as pathe_M_eThtNZ_resolve, join } from "./3160.js";
4
- import "./487.js";
5
- import { createWorkerMetaMessage, createBirpc } from "./4597.js";
6
- import { createCoverageProvider } from "./5734.js";
7
- import { formatTestError, setRealTimers, getRealTimers } from "./1294.js";
8
- import { globalApis } from "./1157.js";
3
+ import { existsSync, promises } from "node:fs";
4
+ import "./1255.js";
5
+ import { createWorkerMetaMessage, createBirpc } from "./1983.js";
6
+ import { basename, isAbsolute, color, dirname, resolve as pathe_M_eThtNZ_resolve, join } from "./6830.js";
7
+ import { createCoverageProvider } from "./7704.js";
8
+ import { formatTestError, setRealTimers, getRealTimers } from "./7552.js";
9
+ import { globalApis } from "./4411.js";
9
10
  const processSend = process.send.bind(process);
10
11
  const processOn = process.on.bind(process);
11
12
  const processOff = process.off.bind(process);
@@ -33,7 +34,6 @@ function createRuntimeRpc(options, createBirpcImpl = createBirpc) {
33
34
  rpc
34
35
  };
35
36
  }
36
- const external_node_fs_ = __webpack_require__("node:fs");
37
37
  class NodeSnapshotEnvironment {
38
38
  constructor(options = {}){
39
39
  this.options = options;
@@ -51,22 +51,22 @@ class NodeSnapshotEnvironment {
51
51
  return join(join(dirname(filepath), this.options.snapshotsDirName ?? "__snapshots__"), `${basename(filepath)}.snap`);
52
52
  }
53
53
  async prepareDirectory(dirPath) {
54
- await external_node_fs_.promises.mkdir(dirPath, {
54
+ await promises.mkdir(dirPath, {
55
55
  recursive: true
56
56
  });
57
57
  }
58
58
  async saveSnapshotFile(filepath, snapshot) {
59
- await external_node_fs_.promises.mkdir(dirname(filepath), {
59
+ await promises.mkdir(dirname(filepath), {
60
60
  recursive: true
61
61
  });
62
- await external_node_fs_.promises.writeFile(filepath, snapshot, "utf-8");
62
+ await promises.writeFile(filepath, snapshot, "utf-8");
63
63
  }
64
64
  async readSnapshotFile(filepath) {
65
- if (!(0, external_node_fs_.existsSync)(filepath)) return null;
66
- return external_node_fs_.promises.readFile(filepath, "utf-8");
65
+ if (!existsSync(filepath)) return null;
66
+ return promises.readFile(filepath, "utf-8");
67
67
  }
68
68
  async removeSnapshotFile(filepath) {
69
- if ((0, external_node_fs_.existsSync)(filepath)) await external_node_fs_.promises.unlink(filepath);
69
+ if (existsSync(filepath)) await promises.unlink(filepath);
70
70
  }
71
71
  }
72
72
  class RstestSnapshotEnvironment extends NodeSnapshotEnvironment {
@@ -128,9 +128,7 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot,
128
128
  const { runtimeConfig: { globals, printConsoleTrace, disableConsoleIntercept, testEnvironment, snapshotFormat, env } } = context;
129
129
  setupEnv(env);
130
130
  if (!disableConsoleIntercept) {
131
- const { createCustomConsole } = await import("./0~130.js").then((mod)=>({
132
- createCustomConsole: mod.createCustomConsole
133
- }));
131
+ const { createCustomConsole } = await import("./0~console.js");
134
132
  global.console = createCustomConsole({
135
133
  rpc,
136
134
  testPath,
@@ -151,9 +149,7 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot,
151
149
  testPath,
152
150
  environment: 'node'
153
151
  };
154
- const { createRstestRuntime } = await import("./6151.js").then((mod)=>({
155
- createRstestRuntime: mod.createRstestRuntime
156
- }));
152
+ const { createRstestRuntime } = await import("./1949.js");
157
153
  const unhandledErrors = [];
158
154
  const handleError = (e, type)=>{
159
155
  const error = 'string' == typeof e ? new Error(e) : e;
@@ -180,18 +176,14 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot,
180
176
  break;
181
177
  case 'jsdom':
182
178
  {
183
- const { environment } = await import("./0~62.js").then((mod)=>({
184
- environment: mod.environment
185
- }));
179
+ const { environment } = await import("./0~jsdom.js");
186
180
  const { teardown } = await environment.setup(global, testEnvironment.options || {});
187
181
  cleanupFns.push(()=>teardown(global));
188
182
  break;
189
183
  }
190
184
  case 'happy-dom':
191
185
  {
192
- const { environment } = await import("./0~4809.js").then((mod)=>({
193
- environment: mod.environment
194
- }));
186
+ const { environment } = await import("./0~happyDom.js");
195
187
  const { teardown } = await environment.setup(global, testEnvironment.options || {});
196
188
  cleanupFns.push(async ()=>teardown(global));
197
189
  break;
@@ -219,16 +211,7 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot,
219
211
  };
220
212
  };
221
213
  const loadFiles = async ({ setupEntries, assetFiles, rstestContext, distPath, testPath, interopDefault, isolate, outputModule })=>{
222
- const { loadModule } = outputModule ? await import("./0~6923.js").then((mod)=>({
223
- EsmMode: mod.loadEsModule_EsmMode,
224
- asModule: mod.asModule,
225
- clearModuleCache: mod.clearModuleCache,
226
- loadModule: mod.loadModule
227
- })) : await import("./0~5835.js").then((mod)=>({
228
- cacheableLoadModule: mod.cacheableLoadModule,
229
- clearModuleCache: mod.clearModuleCache,
230
- loadModule: mod.loadModule
231
- }));
214
+ const { loadModule } = outputModule ? await import("./0~loadEsModule.js") : await import("./0~loadModule.js");
232
215
  if (!isolate) await loadModule({
233
216
  codeContent: `if (global && typeof global.__rstest_clean_core_cache__ === 'function') {
234
217
  global.__rstest_clean_core_cache__();
@@ -281,16 +264,7 @@ const runInPool = async (options)=>{
281
264
  await new Promise((resolve)=>getRealTimers().setTimeout(resolve));
282
265
  await Promise.all(cleanups.map((fn)=>fn()));
283
266
  if (!isolate) {
284
- const { clearModuleCache } = options.context.outputModule ? await import("./0~6923.js").then((mod)=>({
285
- EsmMode: mod.loadEsModule_EsmMode,
286
- asModule: mod.asModule,
287
- clearModuleCache: mod.clearModuleCache,
288
- loadModule: mod.loadModule
289
- })) : await import("./0~5835.js").then((mod)=>({
290
- cacheableLoadModule: mod.cacheableLoadModule,
291
- clearModuleCache: mod.clearModuleCache,
292
- loadModule: mod.loadModule
293
- }));
267
+ const { clearModuleCache } = options.context.outputModule ? await import("./0~loadEsModule.js") : await import("./0~loadModule.js");
294
268
  clearModuleCache();
295
269
  }
296
270
  isTeardown = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rstest/core",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "The Rsbuild-based test tool.",
5
5
  "bugs": {
6
6
  "url": "https://github.com/web-infra-dev/rstest/issues"
@@ -54,7 +54,7 @@
54
54
  "importMeta.d.ts"
55
55
  ],
56
56
  "dependencies": {
57
- "@rsbuild/core": "^2.0.0-beta.6",
57
+ "@rsbuild/core": "2.0.0-beta.8",
58
58
  "@types/chai": "^5.2.3",
59
59
  "tinypool": "^2.1.0"
60
60
  },
@@ -66,7 +66,7 @@
66
66
  "@jridgewell/trace-mapping": "0.3.31",
67
67
  "@microsoft/api-extractor": "^7.57.6",
68
68
  "@rsbuild/plugin-node-polyfill": "^1.4.4",
69
- "@rslib/core": "^0.19.6",
69
+ "@rslib/core": "0.20.0",
70
70
  "@sinonjs/fake-timers": "^15.1.0",
71
71
  "@types/babel__code-frame": "^7.27.0",
72
72
  "@types/istanbul-lib-coverage": "^2.0.6",
@@ -94,15 +94,15 @@
94
94
  "rslog": "^2.0.0",
95
95
  "source-map-support": "^0.5.21",
96
96
  "stacktrace-parser": "0.1.11",
97
- "std-env": "^3.10.0",
97
+ "std-env": "^4.0.0",
98
98
  "strip-ansi": "^7.1.2",
99
99
  "tinyglobby": "^0.2.15",
100
100
  "tinyspy": "^4.0.4",
101
101
  "url-extras": "^0.1.0",
102
102
  "webpack-license-plugin": "^4.5.1",
103
103
  "webpack": "^5.105.2",
104
- "@rstest/browser-ui": "0.0.0",
105
- "@rstest/tsconfig": "0.0.1"
104
+ "@rstest/tsconfig": "0.0.1",
105
+ "@rstest/browser-ui": "0.0.0"
106
106
  },
107
107
  "peerDependencies": {
108
108
  "happy-dom": "*",
@@ -1,21 +0,0 @@
1
- /*!
2
- * Copyright 2017 Vercel, Inc.
3
- *
4
- * This file is derived from Vercel's detect-agent:
5
- * https://github.com/vercel/vercel/tree/main/packages/detect-agent
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- *
19
- * Modifications in this derived work:
20
- * - Removed async determine logic, kept only env detection.
21
- */