diff --git a/tests/lib/util/npm-utils.js b/tests/lib/util/npm-utils.js index 5c8e4cc845e..1b07f37153f 100644 --- a/tests/lib/util/npm-utils.js +++ b/tests/lib/util/npm-utils.js @@ -162,15 +162,8 @@ describe("npmUtils", () => { }); it("should return false if package.json does not exist", () => { - - /* - * Checking local file system directly, which does not - * contains package.json. This is necessary because mock-fs - * doesn't work in Node.js 11: it throws an error when - * a file is missing rather than returning false. - * TODO: Find a replacement for mock-fs that works in Node 11. - */ - assert.strictEqual(npmUtils.checkPackageJson("/"), false); + mockFs({}); + assert.strictEqual(npmUtils.checkPackageJson(), false); }); });