Skip to content

Commit 6afb5a3

Browse files
committed
cleaning up
1 parent dfe0262 commit 6afb5a3

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

test/functional.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,19 +2661,19 @@ module.exports = {
26612661
splitChunks.minSize = 0;
26622662
});
26632663

2664-
testSetup.runWebpack(config, (webpackAssert) => {
2664+
testSetup.runWebpack(config, () => {
26652665
// in production, we hash the chunk names to avoid exposing any extra details
2666-
const entrypointsData = JSON.parse(webpackAssert.readOutputFile('entrypoints.json'));
2666+
const entrypointsData = JSON.parse(readOutputFileContents('entrypoints.json', config));
26672667
const mainJsFiles = entrypointsData.entrypoints.main.js;
26682668
expect(mainJsFiles).to.have.length(4);
26692669
expect(mainJsFiles[0]).equals('/build/runtime.js');
26702670
// keys 1 and 2 are "split files" with an integer name that sometimes changes
26712671
expect(mainJsFiles[3]).equals('/build/main.js');
26722672

2673-
expect(entrypointsData.entrypoints.main.css[0]).equals('/build/38.css');
2673+
expect(entrypointsData.entrypoints.main.css[0]).matches(/\/build\/(\d)+\.css/);
26742674

26752675
// make split chunks are correct in manifest
2676-
const manifestData = JSON.parse(webpackAssert.readOutputFile('manifest.json'));
2676+
const manifestData = JSON.parse(readOutputFileContents('manifest.json', config));
26772677
mainJsFiles.forEach((file) => {
26782678
// file.substring(1) => /build/main.js -> build/main.js
26792679
expect(Object.keys(manifestData)).includes(file.substring(1));

test/helpers/assert.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -265,16 +265,6 @@ class Assert {
265265
throw new Error(`Files ${Object.keys(expectedFileStrings).join(', ')} were expected to be found in the directory but were not. Actual files: ${actualFiles.join(', ')}`);
266266
}
267267
}
268-
269-
/**
270-
* Return the contents of a built file.
271-
*
272-
* @param {string} filePath
273-
* @return {string}
274-
*/
275-
readOutputFile(filePath) {
276-
return readOutputFile(this.webpackConfig, filePath);
277-
}
278268
}
279269

280270
module.exports = function(webpackConfig) {

0 commit comments

Comments
 (0)