diff --git a/package.json b/package.json index bc3c6b49..cd2232a2 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "standard-version": "^9.3.0", "style-loader": "2.0.0", "typescript": "4.1.3", - "webpack": "5.24.3", + "webpack": "^5.79.0", "webpack-cli": "4.5.0", "webpack-recompilation-simulator": "3.2.0" }, diff --git a/spec/example.spec.js b/spec/example.spec.js index acc1837f..7b241c1f 100644 --- a/spec/example.spec.js +++ b/spec/example.spec.js @@ -40,20 +40,24 @@ function runExample (exampleName, done) { } webpack(options, (err, stats) => { - expect(err).toBeFalsy(); - expect(stats.compilation.errors).toEqual([]); - - const dircompare = require('dir-compare'); - const res = dircompare.compareSync(fixturePath, exampleOutput, { compareSize: true }); - - res.diffSet.filter(diff => diff.state === 'distinct').forEach(diff => { - const file1Contents = fs.readFileSync(path.join(diff.path1, diff.name1)).toString(); - const file2Contents = fs.readFileSync(path.join(diff.path2, diff.name2)).toString(); - expect(file1Contents).toEqual(file2Contents); - }); - - expect(res.same).toBe(true); - rimraf(exampleOutput, done); + try { + expect(err).toBeFalsy(); + expect(stats.compilation.errors).toEqual([]); + + const dircompare = require('dir-compare'); + const res = dircompare.compareSync(fixturePath, exampleOutput, { compareSize: true }); + + res.diffSet.filter(diff => diff.state === 'distinct').forEach(diff => { + const file1Contents = fs.readFileSync(path.join(diff.path1, diff.name1)).toString(); + const file2Contents = fs.readFileSync(path.join(diff.path2, diff.name2)).toString(); + expect(file1Contents).toEqual(file2Contents); + }); + + expect(res.same).toBe(true); + rimraf(exampleOutput, done); + } catch (e) { + done(e); + } }); }); }