@rspack/test-tools 1.5.6 → 1.5.8

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 (125) hide show
  1. package/dist/case/builtin.d.ts +2 -0
  2. package/dist/case/builtin.js +173 -13
  3. package/dist/case/cache.d.ts +1 -1
  4. package/dist/case/cache.js +210 -11
  5. package/dist/case/common.d.ts +10 -0
  6. package/dist/case/common.js +239 -0
  7. package/dist/case/compiler.d.ts +7 -4
  8. package/dist/case/compiler.js +144 -109
  9. package/dist/case/config.d.ts +5 -1
  10. package/dist/case/config.js +102 -16
  11. package/dist/case/defaults.d.ts +12 -4
  12. package/dist/case/defaults.js +67 -12
  13. package/dist/case/diagnostic.d.ts +6 -0
  14. package/dist/case/diagnostic.js +123 -14
  15. package/dist/case/diff.d.ts +17 -1
  16. package/dist/case/diff.js +170 -22
  17. package/dist/case/error.d.ts +14 -4
  18. package/dist/case/error.js +117 -10
  19. package/dist/case/esm-output.d.ts +1 -0
  20. package/dist/case/esm-output.js +96 -0
  21. package/dist/case/hash.d.ts +1 -1
  22. package/dist/case/hash.js +70 -9
  23. package/dist/case/hook.d.ts +35 -4
  24. package/dist/case/hook.js +210 -21
  25. package/dist/case/hot-step.js +307 -9
  26. package/dist/case/hot.d.ts +8 -1
  27. package/dist/case/hot.js +235 -8
  28. package/dist/case/incremental.d.ts +1 -1
  29. package/dist/case/incremental.js +39 -41
  30. package/dist/case/index.d.ts +21 -20
  31. package/dist/case/index.js +46 -34
  32. package/dist/case/native-watcher.js +10 -23
  33. package/dist/case/normal.js +174 -12
  34. package/dist/case/runner.d.ts +18 -0
  35. package/dist/case/runner.js +108 -0
  36. package/dist/case/serial.d.ts +1 -1
  37. package/dist/case/serial.js +8 -12
  38. package/dist/case/stats-api.d.ts +0 -5
  39. package/dist/case/stats-api.js +71 -10
  40. package/dist/case/stats-output.d.ts +10 -0
  41. package/dist/case/stats-output.js +198 -9
  42. package/dist/case/treeshaking.js +34 -7
  43. package/dist/case/watch.d.ts +27 -0
  44. package/dist/case/watch.js +321 -21
  45. package/dist/helper/plugins/hot-update.d.ts +2 -2
  46. package/dist/index.d.ts +0 -2
  47. package/dist/index.js +0 -2
  48. package/dist/runner/index.d.ts +2 -7
  49. package/dist/runner/index.js +2 -7
  50. package/dist/runner/{runner/node → node}/index.d.ts +1 -2
  51. package/dist/runner/{runner/node → node}/index.js +13 -9
  52. package/dist/runner/{runner/web → web}/fake.d.ts +1 -2
  53. package/dist/runner/{runner/web → web}/fake.js +7 -7
  54. package/dist/runner/{runner/web → web}/index.d.ts +2 -2
  55. package/dist/runner/{runner/web → web}/index.js +1 -1
  56. package/dist/runner/{runner/web → web}/jsdom.d.ts +1 -2
  57. package/dist/runner/{runner/web → web}/jsdom.js +4 -4
  58. package/dist/test/context.d.ts +3 -5
  59. package/dist/test/context.js +22 -12
  60. package/dist/test/creator.d.ts +13 -12
  61. package/dist/test/creator.js +52 -43
  62. package/dist/test/tester.js +4 -1
  63. package/dist/type.d.ts +42 -11
  64. package/dist/type.js +7 -1
  65. package/package.json +6 -6
  66. package/dist/processor/basic.d.ts +0 -24
  67. package/dist/processor/basic.js +0 -147
  68. package/dist/processor/builtin.d.ts +0 -9
  69. package/dist/processor/builtin.js +0 -171
  70. package/dist/processor/cache.d.ts +0 -20
  71. package/dist/processor/cache.js +0 -131
  72. package/dist/processor/config.d.ts +0 -11
  73. package/dist/processor/config.js +0 -88
  74. package/dist/processor/defaults.d.ts +0 -30
  75. package/dist/processor/defaults.js +0 -72
  76. package/dist/processor/diagnostic.d.ts +0 -15
  77. package/dist/processor/diagnostic.js +0 -104
  78. package/dist/processor/diff.d.ts +0 -30
  79. package/dist/processor/diff.js +0 -140
  80. package/dist/processor/error.d.ts +0 -23
  81. package/dist/processor/error.js +0 -95
  82. package/dist/processor/hash.d.ts +0 -10
  83. package/dist/processor/hash.js +0 -65
  84. package/dist/processor/hook.d.ts +0 -44
  85. package/dist/processor/hook.js +0 -206
  86. package/dist/processor/hot-incremental.d.ts +0 -14
  87. package/dist/processor/hot-incremental.js +0 -43
  88. package/dist/processor/hot-step.d.ts +0 -18
  89. package/dist/processor/hot-step.js +0 -307
  90. package/dist/processor/hot.d.ts +0 -17
  91. package/dist/processor/hot.js +0 -147
  92. package/dist/processor/index.d.ts +0 -20
  93. package/dist/processor/index.js +0 -36
  94. package/dist/processor/multi.d.ts +0 -17
  95. package/dist/processor/multi.js +0 -73
  96. package/dist/processor/normal.d.ts +0 -12
  97. package/dist/processor/normal.js +0 -170
  98. package/dist/processor/simple.d.ts +0 -24
  99. package/dist/processor/simple.js +0 -51
  100. package/dist/processor/snapshot.d.ts +0 -12
  101. package/dist/processor/snapshot.js +0 -66
  102. package/dist/processor/stats-api.d.ts +0 -18
  103. package/dist/processor/stats-api.js +0 -48
  104. package/dist/processor/stats.d.ts +0 -18
  105. package/dist/processor/stats.js +0 -206
  106. package/dist/processor/treeshaking.d.ts +0 -10
  107. package/dist/processor/treeshaking.js +0 -33
  108. package/dist/processor/watch.d.ts +0 -30
  109. package/dist/processor/watch.js +0 -252
  110. package/dist/runner/basic.d.ts +0 -10
  111. package/dist/runner/basic.js +0 -64
  112. package/dist/runner/cache.d.ts +0 -5
  113. package/dist/runner/cache.js +0 -92
  114. package/dist/runner/hot.d.ts +0 -5
  115. package/dist/runner/hot.js +0 -91
  116. package/dist/runner/multiple.d.ts +0 -11
  117. package/dist/runner/multiple.js +0 -52
  118. package/dist/runner/runner/index.d.ts +0 -2
  119. package/dist/runner/runner/index.js +0 -18
  120. package/dist/runner/type.d.ts +0 -42
  121. package/dist/runner/type.js +0 -9
  122. package/dist/runner/watch.d.ts +0 -7
  123. package/dist/runner/watch.js +0 -71
  124. package/dist/test/simple.d.ts +0 -5
  125. package/dist/test/simple.js +0 -43
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createSerialCase = createSerialCase;
4
- const config_1 = require("../processor/config");
5
- const runner_1 = require("../runner");
6
4
  const creator_1 = require("../test/creator");
7
- const type_1 = require("../type");
5
+ const config_1 = require("./config");
6
+ const runner_1 = require("./runner");
8
7
  const creator = new creator_1.BasicCaseCreator({
9
8
  clean: true,
10
9
  describe: false,
@@ -19,15 +18,12 @@ const creator = new creator_1.BasicCaseCreator({
19
18
  return res;
20
19
  };
21
20
  },
22
- steps: ({ name }) => [
23
- new config_1.ConfigProcessor({
24
- name,
25
- runable: true,
26
- compilerType: type_1.ECompilerType.Rspack,
27
- configFiles: ["rspack.config.js", "webpack.config.js"]
28
- })
29
- ],
30
- runner: runner_1.MultipleRunnerFactory
21
+ steps: ({ name }) => [(0, config_1.createConfigProcessor)(name)],
22
+ runner: {
23
+ key: runner_1.getMultiCompilerRunnerKey,
24
+ runner: runner_1.createMultiCompilerRunner
25
+ },
26
+ concurrent: false
31
27
  });
32
28
  function createSerialCase(name, src, dist) {
33
29
  creator.create(name, src, dist);
@@ -1,6 +1 @@
1
- import { type IStatsAPIProcessorOptions } from "../processor";
2
- import { ECompilerType } from "../type";
3
- export type TStatsAPICaseConfig = Omit<IStatsAPIProcessorOptions<ECompilerType.Rspack>, "name" | "compilerType"> & {
4
- description: string;
5
- };
6
1
  export declare function createStatsAPICase(name: string, src: string, dist: string, testConfig: string): void;
@@ -1,21 +1,82 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createStatsAPICase = createStatsAPICase;
4
- const processor_1 = require("../processor");
5
- const simple_1 = require("../test/simple");
6
- const type_1 = require("../type");
4
+ const memfs_1 = require("memfs");
5
+ const creator_1 = require("../test/creator");
6
+ const common_1 = require("./common");
7
7
  let addedSerializer = false;
8
+ const creator = new creator_1.BasicCaseCreator({
9
+ clean: true,
10
+ describe: true,
11
+ steps: ({ name, caseConfig }) => {
12
+ const config = caseConfig;
13
+ return [
14
+ {
15
+ config: async (context) => {
16
+ const compiler = (0, common_1.getCompiler)(context, name);
17
+ compiler.setOptions(options(context, config.options));
18
+ },
19
+ compiler: async (context) => {
20
+ const compilerManager = (0, common_1.getCompiler)(context, name);
21
+ compilerManager.createCompiler();
22
+ compiler(context, compilerManager.getCompiler(), config.compiler);
23
+ },
24
+ build: async (context) => {
25
+ const compiler = (0, common_1.getCompiler)(context, name);
26
+ if (typeof config.build === "function") {
27
+ await config.build(context, compiler.getCompiler());
28
+ }
29
+ else {
30
+ await compiler.build();
31
+ }
32
+ },
33
+ run: async (env, context) => {
34
+ // no need to run, just check the snapshot of diagnostics
35
+ },
36
+ check: async (env, context) => {
37
+ await check(env, context, name, config.check);
38
+ }
39
+ }
40
+ ];
41
+ },
42
+ concurrent: true
43
+ });
8
44
  function createStatsAPICase(name, src, dist, testConfig) {
9
45
  if (!addedSerializer) {
10
46
  addedSerializer = true;
11
47
  }
12
48
  const caseConfig = require(testConfig);
13
- const runner = (0, simple_1.getSimpleProcessorRunner)(src, dist);
14
- it(caseConfig.description, async () => {
15
- await runner(name, new processor_1.StatsAPIProcessor({
16
- name: name,
17
- compilerType: type_1.ECompilerType.Rspack,
18
- ...caseConfig
19
- }));
49
+ creator.create(name, src, dist, undefined, {
50
+ caseConfig,
51
+ description: () => caseConfig.description
20
52
  });
21
53
  }
54
+ function options(context, custom) {
55
+ const res = (custom?.(context) ||
56
+ {});
57
+ res.experiments ??= {};
58
+ res.experiments.css ??= true;
59
+ res.experiments.rspackFuture ??= {};
60
+ res.experiments.rspackFuture.bundlerInfo ??= {};
61
+ res.experiments.rspackFuture.bundlerInfo.force ??= false;
62
+ if (!global.printLogger) {
63
+ res.infrastructureLogging = {
64
+ level: "error"
65
+ };
66
+ }
67
+ return res;
68
+ }
69
+ async function compiler(context, compiler, custom) {
70
+ if (custom) {
71
+ await custom(context, compiler);
72
+ }
73
+ if (compiler) {
74
+ compiler.outputFileSystem = (0, memfs_1.createFsFromVolume)(new memfs_1.Volume());
75
+ }
76
+ }
77
+ async function check(env, context, name, custom) {
78
+ const manager = (0, common_1.getCompiler)(context, name);
79
+ const stats = manager.getStats();
80
+ env.expect(typeof stats).toBe("object");
81
+ await custom?.(stats, manager.getCompiler());
82
+ }
@@ -1 +1,11 @@
1
+ import type { ECompilerType, ITestContext, ITestEnv, TCompilerOptions } from "../type";
2
+ export declare function createStatsProcessor(name: string, defaultOptions: (index: number, context: ITestContext) => TCompilerOptions<ECompilerType.Rspack>, overrideOptions: (index: number, context: ITestContext, options: TCompilerOptions<ECompilerType.Rspack>) => void): {
3
+ before: (context: ITestContext) => Promise<void>;
4
+ config: (context: ITestContext) => Promise<void>;
5
+ compiler: (context: ITestContext) => Promise<void>;
6
+ build: (context: ITestContext) => Promise<void>;
7
+ run: (env: ITestEnv, context: ITestContext) => Promise<void>;
8
+ check: (env: ITestEnv, context: ITestContext) => Promise<void>;
9
+ after: (context: ITestContext) => Promise<void>;
10
+ };
1
11
  export declare function createStatsOutputCase(name: string, src: string, dist: string): void;
@@ -1,23 +1,212 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createStatsProcessor = createStatsProcessor;
3
7
  exports.createStatsOutputCase = createStatsOutputCase;
4
- const stats_1 = require("../processor/stats");
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ const fs_extra_1 = __importDefault(require("fs-extra"));
10
+ const placeholder_1 = require("../helper/expect/placeholder");
11
+ const captureStdio_1 = __importDefault(require("../helper/legacy/captureStdio"));
5
12
  const creator_1 = require("../test/creator");
6
- const type_1 = require("../type");
13
+ const common_1 = require("./common");
14
+ const REG_ERROR_CASE = /error$/;
15
+ function createStatsProcessor(name, defaultOptions, overrideOptions) {
16
+ const writeStatsOuptut = false;
17
+ const snapshotName = "stats.txt";
18
+ let stderr = null;
19
+ return {
20
+ before: async (context) => {
21
+ stderr = (0, captureStdio_1.default)(process.stderr, true);
22
+ },
23
+ config: async (context) => {
24
+ (0, common_1.configMultiCompiler)(context, name, ["rspack.config.js", "webpack.config.js"], defaultOptions, overrideOptions);
25
+ },
26
+ compiler: async (context) => {
27
+ const c = await (0, common_1.compiler)(context, name);
28
+ await statsCompiler(context, c);
29
+ },
30
+ build: async (context) => {
31
+ await (0, common_1.build)(context, name);
32
+ },
33
+ run: async (env, context) => {
34
+ // no need to run, just check snapshot
35
+ },
36
+ check: async (env, context) => {
37
+ await check(env, context, name, writeStatsOuptut, snapshotName, stderr);
38
+ },
39
+ after: async (context) => {
40
+ stderr.restore();
41
+ }
42
+ };
43
+ }
7
44
  const creator = new creator_1.BasicCaseCreator({
8
45
  clean: true,
9
46
  describe: false,
10
47
  steps: ({ name }) => [
11
- new stats_1.StatsProcessor({
12
- name,
13
- snapshotName: "stats.txt",
14
- writeStatsOuptut: false,
15
- compilerType: type_1.ECompilerType.Rspack,
16
- configFiles: ["rspack.config.js", "webpack.config.js"]
17
- })
48
+ createStatsProcessor(name, defaultOptions, overrideOptions)
18
49
  ],
19
50
  description: () => "should print correct stats for"
20
51
  });
21
52
  function createStatsOutputCase(name, src, dist) {
22
53
  creator.create(name, src, dist);
23
54
  }
55
+ function defaultOptions(index, context) {
56
+ if (fs_extra_1.default.existsSync(node_path_1.default.join(context.getSource(), "rspack.config.js"))) {
57
+ return {
58
+ experiments: {
59
+ css: true,
60
+ rspackFuture: {
61
+ bundlerInfo: {
62
+ force: false
63
+ }
64
+ }
65
+ }
66
+ };
67
+ }
68
+ return {
69
+ context: context.getSource(),
70
+ mode: "development",
71
+ entry: "./index.js",
72
+ output: {
73
+ filename: "bundle.js",
74
+ path: context.getDist()
75
+ },
76
+ optimization: {
77
+ minimize: false
78
+ },
79
+ experiments: {
80
+ css: true,
81
+ rspackFuture: {
82
+ bundlerInfo: {
83
+ force: false
84
+ }
85
+ },
86
+ inlineConst: true,
87
+ lazyBarrel: true
88
+ }
89
+ };
90
+ }
91
+ function overrideOptions(index, context, options) {
92
+ if (!options.context)
93
+ options.context = context.getSource();
94
+ if (!options.output)
95
+ options.output = options.output || {};
96
+ if (!options.output.path)
97
+ options.output.path = context.getDist();
98
+ if (!options.plugins)
99
+ options.plugins = [];
100
+ if (!options.optimization)
101
+ options.optimization = {};
102
+ if (options.optimization.minimize === undefined) {
103
+ options.optimization.minimize = false;
104
+ }
105
+ if (!global.printLogger) {
106
+ options.infrastructureLogging = {
107
+ level: "error"
108
+ };
109
+ }
110
+ }
111
+ class RspackStats {
112
+ constructor(value) {
113
+ this.value = value;
114
+ }
115
+ }
116
+ async function check(env, context, name, writeStatsOuptut, snapshot, stderr) {
117
+ const compiler = (0, common_1.getCompiler)(context, name);
118
+ const options = compiler.getOptions();
119
+ const stats = compiler.getStats();
120
+ if (!stats || !compiler)
121
+ return;
122
+ for (const compilation of []
123
+ .concat(stats.stats || stats)
124
+ .map((s) => s.compilation)) {
125
+ compilation.logging.delete("webpack.Compilation.ModuleProfile");
126
+ }
127
+ if (REG_ERROR_CASE.test(name)) {
128
+ env.expect(stats.hasErrors()).toBe(true);
129
+ }
130
+ else if (stats.hasErrors()) {
131
+ throw new Error(stats.toString({
132
+ all: false,
133
+ errors: true
134
+ // errorStack: true,
135
+ // errorDetails: true
136
+ }));
137
+ }
138
+ else if (writeStatsOuptut) {
139
+ fs_extra_1.default.writeFileSync(node_path_1.default.join(context.getDist(), "stats.txt"), stats.toString({
140
+ preset: "verbose",
141
+ // context: context.getSource(),
142
+ colors: false
143
+ }), "utf-8");
144
+ }
145
+ let toStringOptions = {
146
+ context: context.getSource(),
147
+ colors: false
148
+ };
149
+ let hasColorSetting = false;
150
+ if (typeof options.stats !== "undefined") {
151
+ toStringOptions = options.stats;
152
+ if (toStringOptions === null || typeof toStringOptions !== "object")
153
+ toStringOptions = { preset: toStringOptions };
154
+ if (!toStringOptions.context)
155
+ toStringOptions.context = context.getSource();
156
+ hasColorSetting = typeof toStringOptions.colors !== "undefined";
157
+ }
158
+ if (Array.isArray(options) && !toStringOptions.children) {
159
+ toStringOptions.children = options.map(o => o.stats);
160
+ }
161
+ // mock timestamps
162
+ for (const { compilation: s } of [].concat(stats.stats || stats)) {
163
+ env.expect(s.startTime).toBeGreaterThan(0);
164
+ env.expect(s.endTime).toBeGreaterThan(0);
165
+ s.endTime = new Date("04/20/1970, 12:42:42 PM").getTime();
166
+ s.startTime = s.endTime - 1234;
167
+ }
168
+ let actual = stats.toString(toStringOptions);
169
+ env.expect(typeof actual).toBe("string");
170
+ actual = stderr.toString() + actual;
171
+ if (!hasColorSetting) {
172
+ actual = actual
173
+ .replace(/\u001b\[[0-9;]*m/g, "")
174
+ // CHANGE: The time unit display in Rspack is second
175
+ .replace(/[.0-9]+(\s?s)/g, "X$1")
176
+ // CHANGE: Replace bundle size, since bundle sizes may differ between platforms
177
+ .replace(/[0-9]+\.?[0-9]+ KiB/g, "xx KiB");
178
+ }
179
+ const snapshotPath = node_path_1.default.isAbsolute(snapshot)
180
+ ? snapshot
181
+ : node_path_1.default.resolve(context.getSource(), `./__snapshots__/${snapshot}`);
182
+ env.expect(new RspackStats(actual)).toMatchFileSnapshot(snapshotPath);
183
+ const testConfig = context.getTestConfig();
184
+ if (typeof testConfig?.validate === "function") {
185
+ testConfig.validate(stats, stderr.toString());
186
+ }
187
+ }
188
+ async function statsCompiler(context, compiler) {
189
+ const compilers = compiler.compilers
190
+ ? compiler.compilers
191
+ : [compiler];
192
+ for (const compiler of compilers) {
193
+ if (!compiler.inputFileSystem) {
194
+ continue;
195
+ }
196
+ const ifs = compiler.inputFileSystem;
197
+ const inputFileSystem = Object.create(ifs);
198
+ compiler.inputFileSystem = inputFileSystem;
199
+ inputFileSystem.readFile = (...args) => {
200
+ const callback = args.pop();
201
+ ifs.readFile.apply(ifs, args.concat([
202
+ (err, result) => {
203
+ if (err)
204
+ return callback(err);
205
+ if (!/\.(js|json|txt)$/.test(args[0]))
206
+ return callback(null, result);
207
+ callback(null, (0, placeholder_1.normalizePlaceholder)(result.toString("utf-8")));
208
+ }
209
+ ]));
210
+ };
211
+ }
212
+ }
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createTreeShakingCase = createTreeShakingCase;
4
- const treeshaking_1 = require("../processor/treeshaking");
5
4
  const creator_1 = require("../test/creator");
6
- const type_1 = require("../type");
5
+ const builtin_1 = require("./builtin");
6
+ const common_1 = require("./common");
7
7
  const creator = new creator_1.BasicCaseCreator({
8
8
  clean: true,
9
9
  describe: false,
@@ -11,13 +11,40 @@ const creator = new creator_1.BasicCaseCreator({
11
11
  return `${name} with newTreeshaking should match snapshot`;
12
12
  },
13
13
  steps: ({ name }) => [
14
- new treeshaking_1.TreeShakingProcessor({
15
- name,
16
- snapshot: "treeshaking.snap.txt",
17
- compilerType: type_1.ECompilerType.Rspack
18
- })
14
+ {
15
+ config: async (context) => {
16
+ const compiler = (0, common_1.getCompiler)(context, name);
17
+ const options = (0, builtin_1.defaultOptions)(context);
18
+ overrideOptions(context, options);
19
+ compiler.setOptions(options);
20
+ },
21
+ compiler: async (context) => {
22
+ await (0, common_1.compiler)(context, name);
23
+ },
24
+ build: async (context) => {
25
+ await (0, common_1.build)(context, name);
26
+ },
27
+ run: async (env, context) => {
28
+ // no need to run, just check snapshot
29
+ },
30
+ check: async (env, context) => {
31
+ await (0, common_1.checkSnapshot)(env, context, name, "treeshaking.snap.txt");
32
+ }
33
+ }
19
34
  ]
20
35
  });
21
36
  function createTreeShakingCase(name, src, dist) {
22
37
  creator.create(name, src, dist);
23
38
  }
39
+ function overrideOptions(context, options) {
40
+ options.target = options.target || ["web", "es2022"];
41
+ options.optimization ??= {};
42
+ options.optimization.providedExports = true;
43
+ options.optimization.innerGraph = true;
44
+ options.optimization.usedExports = true;
45
+ if (!global.printLogger) {
46
+ options.infrastructureLogging = {
47
+ level: "error"
48
+ };
49
+ }
50
+ }
@@ -1 +1,28 @@
1
+ import { type ECompilerType, type ITestContext, type ITestEnv, type ITestRunner } from "../type";
2
+ export declare function createWatchInitialProcessor(name: string, tempDir: string, step: string, watchState: Record<string, any>, { incremental, nativeWatcher, ignoreNotFriendlyForIncrementalWarnings }?: {
3
+ incremental?: boolean | undefined;
4
+ nativeWatcher?: boolean | undefined;
5
+ ignoreNotFriendlyForIncrementalWarnings?: boolean | undefined;
6
+ }): {
7
+ before: (context: ITestContext) => Promise<void>;
8
+ config: <T extends ECompilerType.Rspack>(context: ITestContext) => Promise<void>;
9
+ compiler: (context: ITestContext) => Promise<void>;
10
+ build: (context: ITestContext) => Promise<void>;
11
+ run: (env: ITestEnv, context: ITestContext) => Promise<void>;
12
+ check: <T extends ECompilerType.Rspack>(env: ITestEnv, context: ITestContext) => Promise<void>;
13
+ };
14
+ export declare function createWatchStepProcessor(name: string, tempDir: string, step: string, watchState: Record<string, any>, { incremental, nativeWatcher, ignoreNotFriendlyForIncrementalWarnings }?: {
15
+ incremental?: boolean | undefined;
16
+ nativeWatcher?: boolean | undefined;
17
+ ignoreNotFriendlyForIncrementalWarnings?: boolean | undefined;
18
+ }): {
19
+ before: (context: ITestContext) => Promise<void>;
20
+ config: <T extends ECompilerType.Rspack>(context: ITestContext) => Promise<void>;
21
+ compiler: (context: ITestContext) => Promise<void>;
22
+ build: (context: ITestContext) => Promise<void>;
23
+ run: (env: ITestEnv, context: ITestContext) => Promise<void>;
24
+ check: <T extends ECompilerType.Rspack>(env: ITestEnv, context: ITestContext) => Promise<void>;
25
+ };
1
26
  export declare function createWatchCase(name: string, src: string, dist: string, temp: string): void;
27
+ export declare function getWatchRunnerKey(context: ITestContext, name: string, file: string): string;
28
+ export declare function createWatchRunner<T extends ECompilerType = ECompilerType.Rspack>(context: ITestContext, name: string, file: string, env: ITestEnv): ITestRunner;