@rspack/test-tools 1.7.0-beta.1 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/case/builtin.d.ts +2 -2
  2. package/dist/case/builtin.js +58 -58
  3. package/dist/case/cache.d.ts +2 -2
  4. package/dist/case/cache.js +34 -34
  5. package/dist/case/common.d.ts +2 -2
  6. package/dist/case/common.js +45 -45
  7. package/dist/case/compiler.d.ts +3 -3
  8. package/dist/case/compiler.js +21 -21
  9. package/dist/case/config.d.ts +3 -3
  10. package/dist/case/config.js +19 -19
  11. package/dist/case/defaults.d.ts +2 -2
  12. package/dist/case/defaults.js +10 -10
  13. package/dist/case/diagnostic.js +29 -29
  14. package/dist/case/error.d.ts +2 -2
  15. package/dist/case/error.js +21 -21
  16. package/dist/case/esm-output.js +28 -28
  17. package/dist/case/example.js +7 -7
  18. package/dist/case/hash.d.ts +2 -2
  19. package/dist/case/hash.js +16 -16
  20. package/dist/case/hook.d.ts +3 -3
  21. package/dist/case/hook.js +42 -42
  22. package/dist/case/hot-step.d.ts +2 -2
  23. package/dist/case/hot-step.js +46 -46
  24. package/dist/case/hot.d.ts +5 -5
  25. package/dist/case/hot.js +43 -43
  26. package/dist/case/incremental.d.ts +2 -2
  27. package/dist/case/incremental.js +9 -9
  28. package/dist/case/index.d.ts +31 -31
  29. package/dist/case/multi-compiler.d.ts +3 -3
  30. package/dist/case/multi-compiler.js +15 -15
  31. package/dist/case/native-watcher.js +6 -6
  32. package/dist/case/normal.js +46 -46
  33. package/dist/case/runner.d.ts +2 -2
  34. package/dist/case/runner.js +22 -15
  35. package/dist/case/serial.d.ts +2 -2
  36. package/dist/case/serial.js +4 -4
  37. package/dist/case/stats-api.d.ts +2 -2
  38. package/dist/case/stats-api.js +7 -7
  39. package/dist/case/stats-output.d.ts +2 -2
  40. package/dist/case/stats-output.js +45 -45
  41. package/dist/case/treeshaking.js +6 -6
  42. package/dist/case/watch.d.ts +1 -1
  43. package/dist/case/watch.js +59 -59
  44. package/dist/compiler.d.ts +3 -3
  45. package/dist/compiler.js +31 -31
  46. package/dist/helper/directory.d.ts +1 -1
  47. package/dist/helper/directory.js +15 -15
  48. package/dist/helper/disable-iconv-lite-warning.js +3 -3
  49. package/dist/helper/expect/diff.js +8 -8
  50. package/dist/helper/expect/error.js +9 -9
  51. package/dist/helper/expect/placeholder.js +9 -9
  52. package/dist/helper/expect/rspack.js +5 -5
  53. package/dist/helper/expect/to-be-typeof.js +2 -2
  54. package/dist/helper/expect/to-end-with.js +3 -3
  55. package/dist/helper/expect/to-match-file-snapshot.d.ts +1 -1
  56. package/dist/helper/expect/to-match-file-snapshot.js +23 -23
  57. package/dist/helper/hot-update/index.d.ts +1 -1
  58. package/dist/helper/hot-update/loader.js +1 -1
  59. package/dist/helper/hot-update/plugin.d.ts +1 -1
  60. package/dist/helper/hot-update/plugin.js +15 -15
  61. package/dist/helper/index.d.ts +8 -8
  62. package/dist/helper/is.js +2 -2
  63. package/dist/helper/legacy/EventSourceForNode.js +8 -8
  64. package/dist/helper/legacy/LogTestPlugin.js +18 -18
  65. package/dist/helper/legacy/asModule.js +6 -6
  66. package/dist/helper/legacy/captureStdio.js +6 -6
  67. package/dist/helper/legacy/checkArrayExpectation.js +24 -24
  68. package/dist/helper/legacy/copyDiff.js +5 -5
  69. package/dist/helper/legacy/createFakeWorker.js +13 -13
  70. package/dist/helper/legacy/createLazyTestEnv.js +12 -12
  71. package/dist/helper/legacy/currentScript.js +1 -1
  72. package/dist/helper/legacy/deprecationTracking.js +5 -5
  73. package/dist/helper/legacy/expectSource.js +5 -5
  74. package/dist/helper/legacy/fakeSystem.js +14 -14
  75. package/dist/helper/legacy/findOutputFiles.js +4 -4
  76. package/dist/helper/legacy/parseResource.js +4 -4
  77. package/dist/helper/legacy/regexEscape.js +2 -2
  78. package/dist/helper/legacy/supportDefaultAssignment.js +2 -2
  79. package/dist/helper/legacy/supportsTextDecoder.js +2 -2
  80. package/dist/helper/legacy/supportsUsing.js +1 -1
  81. package/dist/helper/legacy/urlToRelativePath.js +3 -3
  82. package/dist/helper/parse-modules.js +13 -13
  83. package/dist/helper/read-config-file.d.ts +2 -2
  84. package/dist/helper/read-config-file.js +3 -3
  85. package/dist/helper/serializers.d.ts +1 -1
  86. package/dist/helper/serializers.js +11 -11
  87. package/dist/helper/setup-env.js +17 -17
  88. package/dist/helper/setup-expect.js +1 -1
  89. package/dist/helper/setup-wasm.js +4 -4
  90. package/dist/helper/stringify-config.d.ts +1 -1
  91. package/dist/helper/stringify-config.js +3 -3
  92. package/dist/helper/update-snapshot.js +1 -1
  93. package/dist/helper/util/checkSourceMap.js +16 -17
  94. package/dist/helper/util/checkStats.js +3 -3
  95. package/dist/helper/util/expectWarningFactory.js +2 -2
  96. package/dist/helper/util/filterUtil.js +9 -9
  97. package/dist/index.d.ts +8 -8
  98. package/dist/index.js +1 -1
  99. package/dist/plugin/index.d.ts +1 -1
  100. package/dist/plugin/lazy-compilation-test-plugin.d.ts +1 -1
  101. package/dist/plugin/lazy-compilation-test-plugin.js +13 -13
  102. package/dist/runner/index.d.ts +2 -2
  103. package/dist/runner/node/index.d.ts +2 -2
  104. package/dist/runner/node/index.js +75 -74
  105. package/dist/runner/web/index.d.ts +2 -2
  106. package/dist/runner/web/index.js +45 -45
  107. package/dist/test/context.d.ts +2 -2
  108. package/dist/test/context.js +4 -4
  109. package/dist/test/creator.d.ts +1 -1
  110. package/dist/test/creator.js +28 -28
  111. package/dist/test/debug.d.ts +1 -1
  112. package/dist/test/debug.js +31 -31
  113. package/dist/test/tester.d.ts +1 -1
  114. package/dist/test/tester.js +11 -11
  115. package/dist/type.d.ts +3 -3
  116. package/package.json +3 -3
  117. package/rstest.d.ts +12 -12
@@ -35,7 +35,7 @@ class Tester {
35
35
  fs_extra_1.default.mkdirSync(tempDir, { recursive: true });
36
36
  }
37
37
  for (const i of this.steps) {
38
- if (typeof i.beforeAll === "function") {
38
+ if (typeof i.beforeAll === 'function') {
39
39
  await i.beforeAll(this.context);
40
40
  }
41
41
  }
@@ -45,23 +45,23 @@ class Tester {
45
45
  if (!currentStep)
46
46
  return;
47
47
  await this.runStepMethods(currentStep, [
48
- "before",
49
- "config",
50
- "compiler",
51
- "build"
48
+ 'before',
49
+ 'config',
50
+ 'compiler',
51
+ 'build',
52
52
  ]);
53
53
  }
54
54
  async check(env) {
55
55
  const currentStep = this.steps[this.step];
56
56
  if (!currentStep)
57
57
  return;
58
- await this.runCheckStepMethods(currentStep, env, this.context.hasError() ? ["check"] : ["run", "check"]);
58
+ await this.runCheckStepMethods(currentStep, env, this.context.hasError() ? ['check'] : ['run', 'check']);
59
59
  }
60
60
  async after() {
61
61
  const currentStep = this.steps[this.step];
62
62
  if (!currentStep)
63
63
  return;
64
- await this.runStepMethods(currentStep, ["after"], true);
64
+ await this.runStepMethods(currentStep, ['after'], true);
65
65
  }
66
66
  next() {
67
67
  if (this.context.hasError()) {
@@ -75,7 +75,7 @@ class Tester {
75
75
  }
76
76
  async resume() {
77
77
  for (const i of this.steps) {
78
- if (typeof i.afterAll === "function") {
78
+ if (typeof i.afterAll === 'function') {
79
79
  await i.afterAll(this.context);
80
80
  }
81
81
  }
@@ -98,7 +98,7 @@ class Tester {
98
98
  for (const i of methods) {
99
99
  if (!force && this.context.hasError())
100
100
  return;
101
- if (typeof step[i] === "function") {
101
+ if (typeof step[i] === 'function') {
102
102
  try {
103
103
  await step[i](this.context);
104
104
  }
@@ -111,14 +111,14 @@ class Tester {
111
111
  async runCheckStepMethods(step, env, methods) {
112
112
  try {
113
113
  for (const i of methods) {
114
- if (typeof step[i] === "function") {
114
+ if (typeof step[i] === 'function') {
115
115
  await step[i](env, this.context);
116
116
  }
117
117
  }
118
118
  }
119
119
  catch (e) {
120
120
  const errors = this.context.getError();
121
- console.error(new Error([...errors, e].map(e => e.message).join("\n")));
121
+ console.error(new Error([...errors, e].map((e) => e.message).join('\n')));
122
122
  throw e;
123
123
  }
124
124
  }
package/dist/type.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type EventEmitter from "node:events";
2
- import type { Compiler, MultiStats, RspackOptions, Stats, StatsCompilation } from "@rspack/core";
1
+ import type EventEmitter from 'node:events';
2
+ import type { Compiler, MultiStats, RspackOptions, Stats, StatsCompilation } from '@rspack/core';
3
3
  export interface ITestContext {
4
4
  getSource(sub?: string): string;
5
5
  getDist(sub?: string): string;
@@ -98,7 +98,7 @@ export type TFileCompareResult = TCompareResult & {
98
98
  source: string;
99
99
  dist: string;
100
100
  };
101
- modules: Partial<Record<"modules" | "runtimeModules", TModuleCompareResult[]>>;
101
+ modules: Partial<Record<'modules' | 'runtimeModules', TModuleCompareResult[]>>;
102
102
  };
103
103
  export type TDiffStatsItem = {
104
104
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/test-tools",
3
- "version": "1.7.0-beta.1",
3
+ "version": "1.7.1",
4
4
  "license": "MIT",
5
5
  "description": "Test tools for rspack",
6
6
  "main": "dist/index.js",
@@ -41,7 +41,7 @@
41
41
  "@babel/types": "7.28.5",
42
42
  "cross-env": "^10.1.0",
43
43
  "filenamify": "4.3.0",
44
- "fs-extra": "^11.3.2",
44
+ "fs-extra": "^11.3.3",
45
45
  "iconv-lite": "^0.7.1",
46
46
  "javascript-stringify": "^2.1.0",
47
47
  "jest-diff": "^30.2.0",
@@ -65,7 +65,7 @@
65
65
  "@types/jsdom": "^21.1.7",
66
66
  "typescript": "^5.9.3",
67
67
  "wast-loader": "^1.14.1",
68
- "@rspack/core": "1.7.0-beta.1"
68
+ "@rspack/core": "1.7.1"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "@rspack/core": ">=1.0.0"
package/rstest.d.ts CHANGED
@@ -1,24 +1,24 @@
1
1
  /// <reference types="@rstest/core/globals" />
2
2
 
3
- import type { DiffOptions } from "jest-diff";
3
+ import type { DiffOptions } from 'jest-diff';
4
4
 
5
5
  declare interface FileMatcherOptions {
6
- diff?: DiffOptions;
6
+ diff?: DiffOptions;
7
7
  }
8
8
 
9
- declare module "@rstest/core" {
10
- interface Assertion {
11
- toMatchFileSnapshotSync: (
12
- filename?: string,
13
- options?: FileMatcherOptions
14
- ) => void;
15
- }
9
+ declare module '@rstest/core' {
10
+ interface Assertion {
11
+ toMatchFileSnapshotSync: (
12
+ filename?: string,
13
+ options?: FileMatcherOptions,
14
+ ) => void;
15
+ }
16
16
  }
17
17
 
18
18
  declare global {
19
- type Expect = import("@rstest/core").Expect;
20
- type Describe = import("@rstest/core").Describe;
21
- type Assertion<T> = import("@rstest/core").Assertion<T>;
19
+ type Expect = import('@rstest/core').Expect;
20
+ type Describe = import('@rstest/core').Describe;
21
+ type Assertion<T> = import('@rstest/core').Assertion<T>;
22
22
  }
23
23
 
24
24
  export {};