Skip to content

Commit c41ad27

Browse files
committed
fix(test): webpack test type error
1 parent 24116f3 commit c41ad27

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/purgecss-webpack-plugin/__tests__/index.test.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import * as path from "path";
22
import fs from "fs";
33
import { promisify } from "util";
4-
import webpack, { Configuration, Stats } from "webpack";
4+
import webpack, { Configuration } from "webpack";
55

66
const asyncFs = {
77
readdir: promisify(fs.readdir),
88
};
99

10-
function runWebpack(options: Configuration): Promise<webpack.Stats> {
10+
function runWebpack(
11+
options: Configuration
12+
): Promise<webpack.Stats | undefined> {
1113
const compiler = webpack(options);
12-
return new Promise<webpack.Stats>((resolve, reject) => {
13-
compiler.run((err?: Error, stats?: Stats) => {
14+
return new Promise((resolve, reject) => {
15+
compiler.run((err, stats) => {
1416
if (err) reject(err);
1517
if (stats?.hasErrors()) reject(new Error(stats.toString()));
1618
resolve(stats);

0 commit comments

Comments
 (0)