Skip to content

Commit 16c1f9e

Browse files
committed
(from xxx) => (@ xxx); fix test
1 parent b09a762 commit 16c1f9e

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

lib/ModuleBuildError.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ModuleBuildError extends WebpackError {
1414
this.name = "ModuleBuildError";
1515
this.message = "Module build failed";
1616
if(from) {
17-
this.message += ` (from ${from})`;
17+
this.message += ` (@ ${from})`;
1818
}
1919
this.message += ": ";
2020
if(err !== null && typeof err === "object") {

lib/ModuleError.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ModuleError extends WebpackError {
1515
this.module = module;
1616
this.message = "Module Error";
1717
if(from) {
18-
this.message += ` (from ${from})`;
18+
this.message += ` (@ ${from})`;
1919
}
2020
this.message += ": ";
2121
this.message += err && typeof err === "object" && err.message ? err.message : err;

lib/ModuleWarning.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ModuleWarning extends WebpackError {
1515
this.module = module;
1616
this.message = "Module Warning";
1717
if(from) {
18-
this.message += ` (from ${from})`;
18+
this.message += ` (@ ${from})`;
1919
}
2020
this.message += ": ";
2121
this.message += warning && typeof warning === "object" && warning.message ? warning.message : warning;

test/Errors.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ describe("Errors", () => {
177177
done();
178178
});
179179
});
180-
it.only("should show loader name when emit/throw an error or warning from a loader", () => {
180+
it("should show loader name when emit/throw an error or warning from a loader", () => {
181181
return Promise.all([
182182
getErrorsPromise({
183183
mode: "development",
@@ -196,10 +196,10 @@ describe("Errors", () => {
196196

197197
}, (errors, warnings) => {
198198
warnings.length.should.be.eql(1);
199-
warnings[0].split("\n")[1].should.match(/^Module Warning \(from emit-error-loader\)/);
199+
warnings[0].split("\n")[1].should.match(/^Module Warning \(@ emit-error-loader\)/);
200200
errors.length.should.be.eql(2);
201-
errors[0].split("\n")[1].should.match(/^Module Error \(from emit-error-loader\)/);
202-
errors[1].split("\n")[1].should.match(/^Module build failed \(from json-loader\)/);
201+
errors[0].split("\n")[1].should.match(/^Module Error \(@ emit-error-loader\)/);
202+
errors[1].split("\n")[1].should.match(/^Module build failed \(@ json-loader\)/);
203203
}),
204204
getErrorsPromise({
205205
mode: "development",
@@ -213,7 +213,7 @@ describe("Errors", () => {
213213

214214
}, (errors, warnings) => {
215215
errors.length.should.be.eql(1);
216-
errors[0].split("\n")[1].should.match(/^Module build failed \(from async-error-loader\)/);
216+
errors[0].split("\n")[1].should.match(/^Module build failed \(@ async-error-loader\)/);
217217
}),
218218
getErrorsPromise({
219219
mode: "development",
@@ -227,7 +227,7 @@ describe("Errors", () => {
227227

228228
}, (errors, warnings) => {
229229
errors.length.should.be.eql(1);
230-
errors[0].split("\n")[1].should.match(/^Module build failed \(from throw-error-loader\)/);
230+
errors[0].split("\n")[1].should.match(/^Module build failed \(@ throw-error-loader\)/);
231231
}),
232232

233233
]);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = [
2-
[/Module build failed: Message\nStack/]
3-
];
2+
[/Module build failed( \(@ [^)]+\))?: Message\nStack/]
3+
];

0 commit comments

Comments
 (0)