From d8414b2dd84b00c923aaa58c64dadc7b959f62b9 Mon Sep 17 00:00:00 2001 From: "weiran.zsd" Date: Mon, 11 Feb 2019 13:09:53 +0800 Subject: [PATCH] Revert "Build: fix test failure on Node 11 (#11100)" This reverts commit 709190f8c5d7559b1e0915e25af60b50a94ba1c7. --- tests/lib/util/npm-utils.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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); }); });