Skip to content

Commit 59a73a8

Browse files
committed
[INTERNAL] Fix TypeError test on Node v10
1 parent 01e420d commit 59a73a8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/lib/Compiler.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ describe("Compiler#createFileHandler", function() {
1919
options: {
2020
rootPaths: ["foo"]
2121
},
22-
fileUtils: {},
22+
fileUtils: undefined // This will cause a TypeError when calling fileUtils.readFile
2323
});
2424

2525
const file = "someFile";
2626
const currentFileInfo = {
27-
currentDirectory: undefined // This will cause a TypeError when calling path.join
27+
currentDirectory: "someFolder"
2828
};
2929
const handleDataAndCallCallback = sinon.stub();
3030
const callback = sinon.stub();
@@ -34,8 +34,9 @@ describe("Compiler#createFileHandler", function() {
3434
assert.equal(handleDataAndCallCallback.callCount, 0);
3535
assert.equal(callback.callCount, 1);
3636
assert.equal(callback.getCall(0).args.length, 1);
37+
assert.equal(callback.getCall(0).args[0].name, "TypeError");
3738
assert.equal(callback.getCall(0).args[0].message,
38-
`The "path" argument must be of type string. Received undefined`
39+
`Cannot read property 'readFile' of undefined`
3940
);
4041
});
4142
it("should propagate errors via callback function (File not found)", async function() {

0 commit comments

Comments
 (0)