Skip to content

Commit 9546620

Browse files
committed
Fix error message on missing filepath
1 parent 8b0d194 commit 9546620

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

addAssetHtmlPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function resolvePublicPath(compilation, filename) {
2222

2323
function addFileToAssets(compilation, htmlPluginData, { filepath, typeOfAsset = 'js', includeSourcemap = true, hash = false, publicPath }) {
2424
if (!filepath) {
25-
const error = new Error('No filename defined');
25+
const error = new Error('No filepath defined');
2626
compilation.errors.push(error);
2727
return Promise.reject(error);
2828
}

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test('should invoke callback on error', async t => {
3838
await addAllAssetsToCompilation([{}], compilation, pluginMock, callback);
3939

4040
t.true(compilation.errors.length === 1);
41-
t.true(compilation.errors[0].message === 'No filename defined');
41+
t.true(compilation.errors[0].message === 'No filepath defined');
4242

4343
t.true(callback.calledOnce);
4444
t.true(callback.calledWithExactly(compilation.errors[0], pluginMock));

0 commit comments

Comments
 (0)