Skip to content

Commit c6aa945

Browse files
test: fix
1 parent e144fd2 commit c6aa945

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

test/emit-option.test.js

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -315,42 +315,38 @@ describe("emit option", () => {
315315

316316
await del([outputPath]);
317317

318-
const compiler1 = webpack(webpackConfig);
318+
const compiler = webpack(webpackConfig);
319319

320320
await new Promise((resolve, reject) => {
321-
compiler1.run((error, stats) => {
321+
compiler.run((error, stats) => {
322322
if (error) {
323323
reject(error);
324324

325325
return;
326326
}
327327

328-
compiler1.close(() => {
329-
expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot(
330-
`assets`
331-
);
332-
expect(
333-
Array.from(stats.compilation.emittedAssets).sort()
334-
).toMatchSnapshot(`emittedAssets`);
335-
expect(getWarnings(stats)).toMatchSnapshot("warnings");
336-
expect(getErrors(stats)).toMatchSnapshot("errors");
328+
expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot(
329+
`assets`
330+
);
331+
expect(
332+
Array.from(stats.compilation.emittedAssets).sort()
333+
).toMatchSnapshot(`emittedAssets`);
334+
expect(getWarnings(stats)).toMatchSnapshot("warnings");
335+
expect(getErrors(stats)).toMatchSnapshot("errors");
337336

338-
resolve();
339-
});
337+
resolve();
340338
});
341339
});
342340

343-
const compiler2 = webpack(webpackConfig);
344-
345341
await new Promise((resolve, reject) => {
346-
compiler2.run((error, stats) => {
342+
compiler.run((error, stats) => {
347343
if (error) {
348344
reject(error);
349345

350346
return;
351347
}
352348

353-
compiler2.close(() => {
349+
compiler.close(() => {
354350
expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot(
355351
`assets`
356352
);

0 commit comments

Comments
 (0)