Update unit tests
This commit is contained in:
parent
97fa7696fe
commit
9d4d2bfde8
|
@ -1,6 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
const Tapable = require("tapable").Tapable;
|
||||
const SyncHook = require("tapable").SyncHook;
|
||||
const MultiWatching = require("../lib/MultiWatching");
|
||||
|
||||
|
@ -17,7 +16,6 @@ const createCompiler = () => {
|
|||
watchClose: new SyncHook([])
|
||||
}
|
||||
};
|
||||
Tapable.addCompatLayer(compiler);
|
||||
return compiler;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const util = require("util");
|
||||
|
||||
const WebpackError = require("../lib/WebpackError");
|
||||
|
||||
describe("WebpackError", () => {
|
||||
|
@ -19,11 +16,8 @@ describe("WebpackError", () => {
|
|||
}
|
||||
|
||||
it("Should provide inspect method for use by for util.inspect", () => {
|
||||
const errorStr = util.inspect(new CustomError("Message"));
|
||||
const errorArr = errorStr.split("\n");
|
||||
|
||||
expect(errorArr[0]).toBe("CustomError: CustomMessage");
|
||||
expect(errorArr[1]).toMatch(path.basename(__filename));
|
||||
expect(errorArr[errorArr.length - 1]).toBe("CustomDetails");
|
||||
const error = new CustomError("Message");
|
||||
expect(error.toString()).toContain("CustomError: CustomMessage");
|
||||
expect(error.stack).toContain(__filename);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue