@rspack-canary/test-tools 1.5.6-canary-e598f284-20250921173624 → 1.5.8-canary-e350b761-20250924173613

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 (122) 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 +237 -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/hash.d.ts +1 -1
  20. package/dist/case/hash.js +70 -9
  21. package/dist/case/hook.d.ts +35 -4
  22. package/dist/case/hook.js +210 -21
  23. package/dist/case/hot-step.js +307 -9
  24. package/dist/case/hot.d.ts +8 -1
  25. package/dist/case/hot.js +235 -8
  26. package/dist/case/incremental.d.ts +1 -1
  27. package/dist/case/incremental.js +39 -41
  28. package/dist/case/index.d.ts +20 -20
  29. package/dist/case/index.js +44 -34
  30. package/dist/case/native-watcher.js +10 -23
  31. package/dist/case/normal.js +174 -12
  32. package/dist/case/runner.d.ts +18 -0
  33. package/dist/case/runner.js +108 -0
  34. package/dist/case/serial.d.ts +1 -1
  35. package/dist/case/serial.js +8 -12
  36. package/dist/case/stats-api.d.ts +0 -5
  37. package/dist/case/stats-api.js +71 -10
  38. package/dist/case/stats-output.js +197 -11
  39. package/dist/case/treeshaking.js +34 -7
  40. package/dist/case/watch.d.ts +27 -0
  41. package/dist/case/watch.js +321 -21
  42. package/dist/helper/plugins/hot-update.d.ts +2 -2
  43. package/dist/index.d.ts +0 -2
  44. package/dist/index.js +0 -2
  45. package/dist/runner/index.d.ts +2 -7
  46. package/dist/runner/index.js +2 -7
  47. package/dist/runner/{runner/node → node}/index.d.ts +1 -2
  48. package/dist/runner/{runner/node → node}/index.js +2 -2
  49. package/dist/runner/{runner/web → web}/fake.d.ts +1 -2
  50. package/dist/runner/{runner/web → web}/fake.js +7 -7
  51. package/dist/runner/{runner/web → web}/index.d.ts +2 -2
  52. package/dist/runner/{runner/web → web}/index.js +1 -1
  53. package/dist/runner/{runner/web → web}/jsdom.d.ts +1 -2
  54. package/dist/runner/{runner/web → web}/jsdom.js +4 -4
  55. package/dist/test/context.d.ts +3 -5
  56. package/dist/test/context.js +22 -12
  57. package/dist/test/creator.d.ts +13 -12
  58. package/dist/test/creator.js +52 -43
  59. package/dist/test/tester.js +4 -1
  60. package/dist/type.d.ts +42 -11
  61. package/dist/type.js +7 -1
  62. package/package.json +5 -5
  63. package/dist/processor/basic.d.ts +0 -24
  64. package/dist/processor/basic.js +0 -147
  65. package/dist/processor/builtin.d.ts +0 -9
  66. package/dist/processor/builtin.js +0 -171
  67. package/dist/processor/cache.d.ts +0 -20
  68. package/dist/processor/cache.js +0 -131
  69. package/dist/processor/config.d.ts +0 -11
  70. package/dist/processor/config.js +0 -88
  71. package/dist/processor/defaults.d.ts +0 -30
  72. package/dist/processor/defaults.js +0 -72
  73. package/dist/processor/diagnostic.d.ts +0 -15
  74. package/dist/processor/diagnostic.js +0 -104
  75. package/dist/processor/diff.d.ts +0 -30
  76. package/dist/processor/diff.js +0 -140
  77. package/dist/processor/error.d.ts +0 -23
  78. package/dist/processor/error.js +0 -95
  79. package/dist/processor/hash.d.ts +0 -10
  80. package/dist/processor/hash.js +0 -65
  81. package/dist/processor/hook.d.ts +0 -44
  82. package/dist/processor/hook.js +0 -206
  83. package/dist/processor/hot-incremental.d.ts +0 -14
  84. package/dist/processor/hot-incremental.js +0 -43
  85. package/dist/processor/hot-step.d.ts +0 -18
  86. package/dist/processor/hot-step.js +0 -307
  87. package/dist/processor/hot.d.ts +0 -17
  88. package/dist/processor/hot.js +0 -147
  89. package/dist/processor/index.d.ts +0 -20
  90. package/dist/processor/index.js +0 -36
  91. package/dist/processor/multi.d.ts +0 -17
  92. package/dist/processor/multi.js +0 -73
  93. package/dist/processor/normal.d.ts +0 -12
  94. package/dist/processor/normal.js +0 -170
  95. package/dist/processor/simple.d.ts +0 -24
  96. package/dist/processor/simple.js +0 -51
  97. package/dist/processor/snapshot.d.ts +0 -12
  98. package/dist/processor/snapshot.js +0 -66
  99. package/dist/processor/stats-api.d.ts +0 -18
  100. package/dist/processor/stats-api.js +0 -48
  101. package/dist/processor/stats.d.ts +0 -18
  102. package/dist/processor/stats.js +0 -206
  103. package/dist/processor/treeshaking.d.ts +0 -10
  104. package/dist/processor/treeshaking.js +0 -33
  105. package/dist/processor/watch.d.ts +0 -30
  106. package/dist/processor/watch.js +0 -252
  107. package/dist/runner/basic.d.ts +0 -10
  108. package/dist/runner/basic.js +0 -64
  109. package/dist/runner/cache.d.ts +0 -5
  110. package/dist/runner/cache.js +0 -92
  111. package/dist/runner/hot.d.ts +0 -5
  112. package/dist/runner/hot.js +0 -91
  113. package/dist/runner/multiple.d.ts +0 -11
  114. package/dist/runner/multiple.js +0 -52
  115. package/dist/runner/runner/index.d.ts +0 -2
  116. package/dist/runner/runner/index.js +0 -18
  117. package/dist/runner/type.d.ts +0 -42
  118. package/dist/runner/type.js +0 -9
  119. package/dist/runner/watch.d.ts +0 -7
  120. package/dist/runner/watch.js +0 -71
  121. package/dist/test/simple.d.ts +0 -5
  122. package/dist/test/simple.js +0 -43
@@ -1 +1,3 @@
1
+ import type { ECompilerType, ITestContext, TCompilerOptions } from "../type";
1
2
  export declare function createBuiltinCase(name: string, src: string, dist: string): void;
3
+ export declare function defaultOptions<T extends ECompilerType.Rspack>(context: ITestContext): TCompilerOptions<T>;
@@ -4,16 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createBuiltinCase = createBuiltinCase;
7
+ exports.defaultOptions = defaultOptions;
7
8
  const node_path_1 = __importDefault(require("node:path"));
9
+ const core_1 = require("@rspack/core");
10
+ const fs_extra_1 = __importDefault(require("fs-extra"));
11
+ const webpack_merge_1 = require("webpack-merge");
8
12
  const helper_1 = require("../helper");
9
- const processor_1 = require("../processor");
10
13
  const creator_1 = require("../test/creator");
11
- const type_1 = require("../type");
12
- const FILTERS = {
13
- "plugin-css": (file) => file.endsWith(".css"),
14
- "plugin-css-modules": (file) => file.endsWith(".css") || ((0, helper_1.isJavaScript)(file) && !file.includes("runtime")),
15
- "plugin-html": (file) => file.endsWith(".html")
16
- };
14
+ const common_1 = require("./common");
17
15
  const creator = new creator_1.BasicCaseCreator({
18
16
  clean: true,
19
17
  describe: false,
@@ -24,12 +22,24 @@ const creator = new creator_1.BasicCaseCreator({
24
22
  const cat = node_path_1.default.basename(node_path_1.default.dirname(src));
25
23
  const filter = FILTERS[cat];
26
24
  return [
27
- new processor_1.BuiltinProcessor({
28
- name,
29
- snapshot: "output.snap.txt",
30
- snapshotFileFilter: filter,
31
- compilerType: type_1.ECompilerType.Rspack
32
- })
25
+ {
26
+ config: async (context) => {
27
+ const compiler = (0, common_1.getCompiler)(context, name);
28
+ compiler.setOptions(defaultOptions(context));
29
+ },
30
+ compiler: async (context) => {
31
+ await (0, common_1.compiler)(context, name);
32
+ },
33
+ build: async (context) => {
34
+ await (0, common_1.build)(context, name);
35
+ },
36
+ run: async (env, context) => {
37
+ // no need to run, just check snapshot
38
+ },
39
+ check: async (env, context) => {
40
+ await (0, common_1.checkSnapshot)(env, context, name, "output.snap.txt", filter);
41
+ }
42
+ }
33
43
  ];
34
44
  },
35
45
  concurrent: true
@@ -37,3 +47,153 @@ const creator = new creator_1.BasicCaseCreator({
37
47
  function createBuiltinCase(name, src, dist) {
38
48
  creator.create(name, src, dist);
39
49
  }
50
+ function defaultOptions(context) {
51
+ let defaultOptions = {
52
+ entry: {
53
+ main: {
54
+ import: "./index"
55
+ }
56
+ },
57
+ output: {
58
+ publicPath: "/",
59
+ path: context.getDist(),
60
+ filename: "[name].js",
61
+ chunkFilename: "[name].js",
62
+ chunkFormat: "array-push",
63
+ cssFilename: "[name].css",
64
+ cssChunkFilename: "[name].css",
65
+ assetModuleFilename: "[hash][ext][query]",
66
+ sourceMapFilename: "[file].map",
67
+ chunkLoadingGlobal: "webpackChunkwebpack",
68
+ chunkLoading: "jsonp",
69
+ uniqueName: "__rspack_test__",
70
+ enabledLibraryTypes: ["system"],
71
+ strictModuleErrorHandling: false,
72
+ iife: true,
73
+ module: false,
74
+ asyncChunks: true,
75
+ scriptType: false,
76
+ globalObject: "self",
77
+ importFunctionName: "import",
78
+ wasmLoading: "fetch",
79
+ webassemblyModuleFilename: "[hash].module.wasm",
80
+ workerChunkLoading: "import-scripts",
81
+ workerWasmLoading: "fetch"
82
+ },
83
+ module: {
84
+ rules: [
85
+ {
86
+ test: /\.json$/,
87
+ type: "json"
88
+ },
89
+ {
90
+ test: /\.mjs$/,
91
+ type: "javascript/esm"
92
+ },
93
+ {
94
+ test: /\.cjs$/,
95
+ type: "javascript/dynamic"
96
+ },
97
+ {
98
+ test: /\.js$/,
99
+ type: "javascript/auto"
100
+ },
101
+ {
102
+ test: /\.css$/,
103
+ type: "css"
104
+ },
105
+ {
106
+ test: /\.wasm$/,
107
+ type: "webassembly/async"
108
+ }
109
+ ]
110
+ },
111
+ node: {
112
+ __dirname: "mock",
113
+ __filename: "mock",
114
+ global: "warn"
115
+ },
116
+ optimization: {
117
+ runtimeChunk: {
118
+ name: "runtime"
119
+ },
120
+ minimize: false,
121
+ removeAvailableModules: true,
122
+ removeEmptyChunks: true,
123
+ moduleIds: "named",
124
+ chunkIds: "named",
125
+ sideEffects: false,
126
+ mangleExports: false,
127
+ usedExports: false,
128
+ concatenateModules: false,
129
+ nodeEnv: false
130
+ },
131
+ resolve: {
132
+ extensions: [
133
+ ".js",
134
+ ".jsx",
135
+ ".ts",
136
+ ".tsx",
137
+ ".json",
138
+ ".d.ts",
139
+ ".css",
140
+ ".wasm"
141
+ ]
142
+ },
143
+ resolveLoader: {
144
+ extensions: [".js"]
145
+ },
146
+ experiments: {
147
+ css: true,
148
+ futureDefaults: true,
149
+ rspackFuture: {
150
+ bundlerInfo: {
151
+ force: false
152
+ }
153
+ }
154
+ },
155
+ devtool: false,
156
+ context: context.getSource(),
157
+ plugins: []
158
+ };
159
+ const testConfigFile = context.getSource("rspack.config.js");
160
+ if (fs_extra_1.default.existsSync(testConfigFile)) {
161
+ const caseOptions = require(testConfigFile);
162
+ if (caseOptions.entry) {
163
+ delete defaultOptions.entry;
164
+ }
165
+ defaultOptions = (0, webpack_merge_1.merge)(defaultOptions, caseOptions);
166
+ }
167
+ // TODO: remove builtin compatible code
168
+ const defineOptions = defaultOptions.builtins?.define;
169
+ if (defineOptions) {
170
+ defaultOptions.plugins.push(new core_1.rspack.DefinePlugin(defineOptions));
171
+ }
172
+ const provideOptions = defaultOptions.builtins?.provide;
173
+ if (provideOptions) {
174
+ defaultOptions.plugins.push(new core_1.rspack.ProvidePlugin(provideOptions));
175
+ }
176
+ const htmlOptions = defaultOptions.builtins?.html;
177
+ if (htmlOptions) {
178
+ if (Array.isArray(htmlOptions)) {
179
+ for (const item of htmlOptions) {
180
+ defaultOptions.plugins.push(new core_1.rspack.HtmlRspackPlugin(item));
181
+ }
182
+ }
183
+ else {
184
+ defaultOptions.plugins.push(new core_1.rspack.HtmlRspackPlugin(htmlOptions));
185
+ }
186
+ }
187
+ delete defaultOptions.builtins;
188
+ if (!global.printLogger) {
189
+ defaultOptions.infrastructureLogging = {
190
+ level: "error"
191
+ };
192
+ }
193
+ return defaultOptions;
194
+ }
195
+ const FILTERS = {
196
+ "plugin-css": (file) => file.endsWith(".css"),
197
+ "plugin-css-modules": (file) => file.endsWith(".css") || ((0, helper_1.isJavaScript)(file) && !file.includes("runtime")),
198
+ "plugin-html": (file) => file.endsWith(".html")
199
+ };
@@ -1,2 +1,2 @@
1
- import { ECompilerType, type TCompilerOptions } from "../type";
1
+ import { type ECompilerType, type TCompilerOptions } from "../type";
2
2
  export declare function createCacheCase(name: string, src: string, dist: string, target: TCompilerOptions<ECompilerType.Rspack>["target"], temp: string): void;
@@ -1,11 +1,55 @@
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 });
3
6
  exports.createCacheCase = createCacheCase;
4
- const cache_1 = require("../processor/cache");
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const core_1 = __importDefault(require("@rspack/core"));
9
+ const helper_1 = require("../helper");
10
+ const hot_update_1 = require("../helper/hot-update");
11
+ const checkArrayExpectation_1 = __importDefault(require("../helper/legacy/checkArrayExpectation"));
5
12
  const runner_1 = require("../runner");
6
13
  const creator_1 = require("../test/creator");
7
14
  const type_1 = require("../type");
8
- const creators = new Map();
15
+ const common_1 = require("./common");
16
+ const runner_2 = require("./runner");
17
+ const MAX_COMPILER_INDEX = 100;
18
+ function createCacheProcessor(name, src, temp, target) {
19
+ const updatePlugin = new hot_update_1.HotUpdatePlugin(src, temp);
20
+ return {
21
+ before: async (context) => {
22
+ await updatePlugin.initialize();
23
+ context.setValue(name, "hotUpdateContext", updatePlugin);
24
+ },
25
+ config: async (context) => {
26
+ const compiler = (0, common_1.getCompiler)(context, name);
27
+ let options = defaultOptions(context, temp, target);
28
+ options = await (0, common_1.config)(context, name, ["rspack.config.js", "webpack.config.js"].map(i => node_path_1.default.resolve(temp, i)), options);
29
+ overrideOptions(options, temp, target, updatePlugin);
30
+ compiler.setOptions(options);
31
+ },
32
+ compiler: async (context) => {
33
+ await (0, common_1.compiler)(context, name);
34
+ },
35
+ build: async (context) => {
36
+ await (0, common_1.build)(context, name);
37
+ },
38
+ run: async (env, context) => {
39
+ await (0, common_1.run)(env, context, name, context => findBundle(name, target, context));
40
+ },
41
+ check: async (env, context) => {
42
+ await (0, common_1.check)(env, context, name);
43
+ },
44
+ afterAll: async (context) => {
45
+ const updateIndex = updatePlugin.getUpdateIndex();
46
+ const totalUpdates = updatePlugin.getTotalUpdates();
47
+ if (updateIndex + 1 !== totalUpdates) {
48
+ throw new Error(`Should run all hot steps (${updateIndex + 1} / ${totalUpdates}): ${name}`);
49
+ }
50
+ }
51
+ };
52
+ }
9
53
  function getCreator(target) {
10
54
  if (!creators.has(target)) {
11
55
  creators.set(target, new creator_1.BasicCaseCreator({
@@ -13,16 +57,12 @@ function getCreator(target) {
13
57
  describe: true,
14
58
  target,
15
59
  steps: ({ name, src, target, temp }) => [
16
- new cache_1.CacheProcessor({
17
- name,
18
- sourceDir: src,
19
- tempDir: temp,
20
- target: target,
21
- compilerType: type_1.ECompilerType.Rspack,
22
- configFiles: ["rspack.config.js", "webpack.config.js"]
23
- })
60
+ createCacheProcessor(name, src, temp, target)
24
61
  ],
25
- runner: runner_1.CacheRunnerFactory,
62
+ runner: {
63
+ key: (context, name, file) => name,
64
+ runner: createRunner
65
+ },
26
66
  concurrent: true
27
67
  }));
28
68
  }
@@ -32,3 +72,162 @@ function createCacheCase(name, src, dist, target, temp) {
32
72
  const creator = getCreator(target);
33
73
  creator.create(name, src, dist, temp);
34
74
  }
75
+ const creators = new Map();
76
+ function defaultOptions(context, temp, target) {
77
+ const options = {
78
+ context: temp,
79
+ mode: "production",
80
+ cache: true,
81
+ devtool: false,
82
+ output: {
83
+ path: context.getDist(),
84
+ filename: "bundle.js",
85
+ chunkFilename: "[name].chunk.[fullhash].js",
86
+ publicPath: "https://test.cases/path/",
87
+ library: { type: "commonjs2" }
88
+ },
89
+ optimization: {
90
+ moduleIds: "named",
91
+ emitOnErrors: true
92
+ },
93
+ target,
94
+ experiments: {
95
+ css: true,
96
+ rspackFuture: {
97
+ bundlerInfo: {
98
+ force: false
99
+ }
100
+ },
101
+ inlineConst: true,
102
+ lazyBarrel: true
103
+ }
104
+ };
105
+ options.plugins ??= [];
106
+ options.plugins.push(new core_1.default.HotModuleReplacementPlugin());
107
+ return options;
108
+ }
109
+ function overrideOptions(options, temp, target, updatePlugin) {
110
+ if (!options.entry) {
111
+ options.entry = "./index.js";
112
+ }
113
+ // rewrite context to temp dir
114
+ options.context = temp;
115
+ options.module ??= {};
116
+ for (const cssModuleType of ["css/auto", "css/module", "css"]) {
117
+ options.module.generator ??= {};
118
+ options.module.generator[cssModuleType] ??= {};
119
+ options.module.generator[cssModuleType].exportsOnly ??=
120
+ target === "async-node";
121
+ }
122
+ options.plugins ??= [];
123
+ options.plugins.push(updatePlugin);
124
+ if (!global.printLogger) {
125
+ options.infrastructureLogging = {
126
+ level: "error"
127
+ };
128
+ }
129
+ }
130
+ function findBundle(name, target, context) {
131
+ const files = [];
132
+ const prefiles = [];
133
+ const compiler = (0, common_1.getCompiler)(context, name);
134
+ if (!compiler)
135
+ throw new Error("Compiler should exists when find bundle");
136
+ const stats = compiler.getStats();
137
+ if (!stats)
138
+ throw new Error("Stats should exists when find bundle");
139
+ const info = stats.toJson({ all: false, entrypoints: true });
140
+ if (target === "web" || target === "webworker") {
141
+ for (const file of info.entrypoints.main.assets) {
142
+ if ((0, helper_1.isJavaScript)(file.name)) {
143
+ files.push(file.name);
144
+ }
145
+ else {
146
+ prefiles.push(file.name);
147
+ }
148
+ }
149
+ }
150
+ else {
151
+ const assets = info.entrypoints.main.assets.filter(s => (0, helper_1.isJavaScript)(s.name));
152
+ files.push(assets[assets.length - 1].name);
153
+ }
154
+ return [...prefiles, ...files];
155
+ }
156
+ function createRunner(context, name, file, env) {
157
+ const compiler = context.getCompiler(name);
158
+ const options = compiler.getOptions();
159
+ let compilerIndex = 0;
160
+ const testConfig = context.getTestConfig();
161
+ const source = context.getSource();
162
+ const dist = context.getDist();
163
+ const updatePlugin = context.getValue(name, "hotUpdateContext");
164
+ const getWebRunner = () => {
165
+ return new runner_1.WebRunner({
166
+ dom: context.getValue(name, "documentType") || type_1.EDocumentType.JSDOM,
167
+ env,
168
+ stats: (0, runner_2.cachedStats)(context, name),
169
+ cachable: false,
170
+ name: name,
171
+ runInNewContext: false,
172
+ testConfig: {
173
+ ...testConfig,
174
+ moduleScope(ms, stats, options) {
175
+ const moduleScope = typeof testConfig.moduleScope === "function"
176
+ ? testConfig.moduleScope(ms, stats, options)
177
+ : ms;
178
+ moduleScope.COMPILER_INDEX = compilerIndex;
179
+ moduleScope.NEXT_HMR = nextHmr;
180
+ moduleScope.NEXT_START = nextStart;
181
+ return moduleScope;
182
+ }
183
+ },
184
+ source,
185
+ dist,
186
+ compilerOptions: options
187
+ });
188
+ };
189
+ const nextHmr = async (m, options) => {
190
+ await updatePlugin.goNext();
191
+ const stats = await compiler.build();
192
+ if (!stats) {
193
+ throw new Error("Should generate stats during build");
194
+ }
195
+ const jsonStats = stats.toJson({
196
+ // errorDetails: true
197
+ });
198
+ const compilerOptions = compiler.getOptions();
199
+ const updateIndex = updatePlugin.getUpdateIndex();
200
+ await (0, checkArrayExpectation_1.default)(source, jsonStats, "error", `errors${updateIndex}`, "Error", compilerOptions);
201
+ await (0, checkArrayExpectation_1.default)(source, jsonStats, "warning", `warnings${updateIndex}`, "Warning", compilerOptions);
202
+ const updatedModules = await m.hot.check(options || true);
203
+ if (!updatedModules) {
204
+ throw new Error("No update available");
205
+ }
206
+ return jsonStats;
207
+ };
208
+ const nextStart = async () => {
209
+ await compiler.close();
210
+ compiler.createCompiler();
211
+ await updatePlugin.goNext();
212
+ const stats = await compiler.build();
213
+ if (!stats) {
214
+ throw new Error("Should generate stats during build");
215
+ }
216
+ const jsonStats = stats.toJson({
217
+ // errorDetails: true
218
+ });
219
+ const compilerOptions = compiler.getOptions();
220
+ const updateIndex = updatePlugin.getUpdateIndex();
221
+ await (0, checkArrayExpectation_1.default)(source, jsonStats, "error", `errors${updateIndex}`, "Error", compilerOptions);
222
+ await (0, checkArrayExpectation_1.default)(source, jsonStats, "warning", `warnings${updateIndex}`, "Warning", compilerOptions);
223
+ env.it(`NEXT_START run with compilerIndex==${compilerIndex + 1}`, async () => {
224
+ if (compilerIndex > MAX_COMPILER_INDEX) {
225
+ throw new Error("NEXT_START has been called more than the maximum times");
226
+ }
227
+ compilerIndex++;
228
+ return getWebRunner().run(file);
229
+ });
230
+ return jsonStats;
231
+ };
232
+ return getWebRunner();
233
+ }
@@ -0,0 +1,10 @@
1
+ import { ECompilerType, type ITestCompilerManager, type ITestContext, type ITestEnv, type TCompiler, type TCompilerOptions } from "../type";
2
+ export declare function getCompiler<T extends ECompilerType = ECompilerType.Rspack>(context: ITestContext, name: string): ITestCompilerManager<T>;
3
+ export declare function config<T extends ECompilerType = ECompilerType.Rspack>(context: ITestContext, name: string, configFiles: string[], defaultOptions?: TCompilerOptions<T>): Promise<TCompilerOptions<T>>;
4
+ export declare function compiler<T extends ECompilerType = ECompilerType.Rspack>(context: ITestContext, name: string): Promise<TCompiler<T>>;
5
+ export declare function build<T extends ECompilerType = ECompilerType.Rspack>(context: ITestContext, name: string): Promise<TCompiler<T>>;
6
+ export declare function run<T extends ECompilerType = ECompilerType.Rspack>(env: ITestEnv, context: ITestContext, name: string, findBundle: (context: ITestContext, options: TCompilerOptions<T>) => string[] | string | void): Promise<void>;
7
+ export declare function check<T extends ECompilerType = ECompilerType.Rspack>(env: ITestEnv, context: ITestContext, name: string): Promise<void>;
8
+ export declare function checkSnapshot<T extends ECompilerType = ECompilerType.Rspack>(env: ITestEnv, context: ITestContext, name: string, snapshot: string, filter?: (file: string) => boolean): Promise<void>;
9
+ export declare function findMultiCompilerBundle<T extends ECompilerType = ECompilerType.Rspack>(context: ITestContext, name: string, multiFindBundle: (index: number, context: ITestContext, options: TCompilerOptions<T>) => string[] | string | void): string[];
10
+ export declare function configMultiCompiler<T extends ECompilerType = ECompilerType.Rspack>(context: ITestContext, name: string, configFiles: string[], defaultOptions: (index: number, context: ITestContext) => TCompilerOptions<T>, overrideOptions: (index: number, context: ITestContext, options: TCompilerOptions<T>) => void): void;