Skip to content

Commit 78a293f

Browse files
committed
test: fix duplicate components test
1 parent a4db849 commit 78a293f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/helper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ exports.createParts = function createParts(options, dirPath, inputFile, fileName
8989

9090
if (_.has(parts, settings.tagName) || _.has(parts, settings.fileType)) {
9191
var type = settings.tagName || settings.fileType;
92-
throw new TypeError(`File "${file}" can't be used as "${type}", because it was already defined in "${_.get(parts[type], 'file', null)}".`);
92+
throw new TypeError(`File "${ file }" can't be used as "${ type }", because it was already defined in "${ _.get(parts[type], 'file', null) }".`);
9393
}
9494

9595
parts[settings.tagName || settings.fileType] = that.createPart(settings, options);

test/loader.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ describe('loader: errors', function () {
4949
});
5050

5151
it('should throw duplication TypeError - multiple components in same directory', function () {
52-
var content = require(duplicateDir + 'Component.vue');
52+
var content = require(twoComponentsDuplicateSameDir + 'SecondComponent.vue');
5353

5454
assert.throws(function () {
55-
loader.apply(_.assign({}, webpack, { context: twoComponentsDuplicateSameDir }), [content, { file: 'Component.vue.js' }]);
56-
}, TypeError, 'File "SecondComponent.vue.html" can\'t be used as "template", because it was already defined in "FirstComponent.vue.html".');
55+
loader.apply(_.assign({}, webpack, { context: twoComponentsDuplicateSameDir }), [content, { file: 'SecondComponent.vue.js' }]);
56+
}, TypeError, 'File "SecondComponent.vue.pug" can\'t be used as "template", because it was already defined in "SecondComponent.vue.html".');
5757
});
5858
});
5959

0 commit comments

Comments
 (0)