From 9686475c8022494dcf5dcff45460729ba6398a6e Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 11 May 2020 09:05:48 +0800 Subject: [PATCH] Test: Remove `graceful-fs` hack (#8245) --- jest.config.js | 6 ------ scripts/build/bundler.js | 4 ---- tests_config/fs.js | 3 --- 3 files changed, 13 deletions(-) delete mode 100644 tests_config/fs.js diff --git a/jest.config.js b/jest.config.js index fdcd4bf86..115f7b218 100644 --- a/jest.config.js +++ b/jest.config.js @@ -23,12 +23,6 @@ module.exports = { ], coverageReporters: ["text", "lcov"], moduleNameMapper: { - // Jest wires `fs` to `graceful-fs`, which causes a memory leak when - // `graceful-fs` does `require('fs')`. - // Ref: https://github.com/facebook/jest/issues/2179#issuecomment-355231418 - // If this is removed, see also scripts/build/build.js. - "graceful-fs": "/tests_config/fs.js", - "prettier/local": "/tests_config/require_prettier.js", "prettier/standalone": "/tests_config/require_standalone.js", }, diff --git a/scripts/build/bundler.js b/scripts/build/bundler.js index 71ea269f6..6980dcceb 100644 --- a/scripts/build/bundler.js +++ b/scripts/build/bundler.js @@ -34,9 +34,6 @@ const EXTERNALS = [ "util", "readline", "tty", - - // See comment in jest.config.js - "graceful-fs", ]; const entries = [ @@ -186,7 +183,6 @@ function getRollupOutputOptions(bundle) { const options = { file: `dist/${bundle.output}`, strict: typeof bundle.strict === "undefined" ? true : bundle.strict, - paths: [{ "graceful-fs": "fs" }], }; if (bundle.target === "node") { diff --git a/tests_config/fs.js b/tests_config/fs.js deleted file mode 100644 index 7ffea821e..000000000 --- a/tests_config/fs.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -module.exports = require("fs");