Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
The new version of webpack has different runtime chunks
  • Loading branch information
stof committed Apr 23, 2021
1 parent 4a533ee commit 325bf18
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.1.1",
"tmp": "^0.2.1",
"webpack": "^5.12",
"webpack": "^5.35",
"webpack-cli": "^4",
"webpack-dev-server": "^4.0.0-beta.0",
"yargs-parser": "^20.2.4"
Expand Down
5 changes: 3 additions & 2 deletions test/bin/encore.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@ module.exports = Encore.getWebpackConfig();
expect(parsedOutput).to.be.an('object');
expect(parsedOutput.modules).to.be.an('array');

// We expect 3 modules there:
// We expect 4 modules there:
// - webpack/runtime/chunk loaded
// - webpack/runtime/jsonp chunk loading
// - webpack/runtime/hasOwnProperty shorthand
// - ./js/no_require.js
expect(parsedOutput.modules.length).to.equal(3);
expect(parsedOutput.modules.length).to.equal(4);


done();
Expand Down
6 changes: 3 additions & 3 deletions test/functional.js
Original file line number Diff line number Diff line change
Expand Up @@ -2666,18 +2666,18 @@ module.exports = {
webpackAssert.assertOutputJsonFileMatches('entrypoints.json', {
entrypoints: {
main: {
js: ['/build/runtime.js', '/build/961.js', '/build/38.js', '/build/main.js'],
js: ['/build/runtime.js', '/build/843.js', '/build/38.js', '/build/main.js'],
css: ['/build/38.css']
},
other: {
js: ['/build/runtime.js', '/build/961.js', '/build/38.js', '/build/other.js'],
js: ['/build/runtime.js', '/build/843.js', '/build/38.js', '/build/other.js'],
css: ['/build/38.css']
}
}
});

// make split chunks are correct in manifest
webpackAssert.assertManifestKeyExists('build/961.js');
webpackAssert.assertManifestKeyExists('build/843.js');

done();
});
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7257,7 +7257,7 @@ webpack-sources@^2.1.1:
source-list-map "^2.0.1"
source-map "^0.6.1"

webpack@^5.12:
webpack@^5.35:
version "5.35.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.35.0.tgz#4db23c2b96c4e53a90c5732d7cdb301a84a33576"
integrity sha512-au3gu55yYF/h6NXFr0KZPZAYxS6Nlc595BzYPke8n0CSff5WXcoixtjh5LC/8mXunkRKxhymhXmBY0+kEbR6jg==
Expand Down

0 comments on commit 325bf18

Please sign in to comment.