From 986b50532108ee56a5c7f88439daefa70ca8ba9e Mon Sep 17 00:00:00 2001 From: liximomo Date: Tue, 14 Apr 2020 19:23:52 +0800 Subject: [PATCH] fix(test): duplicate manual mock found: fs --- package.json | 1 + packages/react-fs/__mocks__/fs.js | 5 ----- packages/react-fs/package.json | 1 - packages/utils/package.json | 3 +-- {packages/utils/src => test}/__mocks__/fs.js | 0 yarn.lock | 2 +- 6 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 packages/react-fs/__mocks__/fs.js rename {packages/utils/src => test}/__mocks__/fs.js (100%) diff --git a/package.json b/package.json index 816ec0fc4..86859ef84 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "lerna": "^3.18.4", "lint-staged": "^10.1.2", "lodash": "^4.17.15", + "memfs": "^3.1.2", "npm-run-all": "^4.1.5", "prettier": "^2.0.4", "puppeteer-core": "^2.1.1", diff --git a/packages/react-fs/__mocks__/fs.js b/packages/react-fs/__mocks__/fs.js deleted file mode 100644 index e220b6f40..000000000 --- a/packages/react-fs/__mocks__/fs.js +++ /dev/null @@ -1,5 +0,0 @@ -const { fs } = require("memfs"); - -fs.__mock__ = true; - -module.exports = fs; diff --git a/packages/react-fs/package.json b/packages/react-fs/package.json index 2f83f329e..589a82aae 100644 --- a/packages/react-fs/package.json +++ b/packages/react-fs/package.json @@ -27,7 +27,6 @@ }, "devDependencies": { "@types/react-reconciler": "^0.18.0", - "memfs": "3.1.2", "react": "16.13.0" }, "peerDependencies": { diff --git a/packages/utils/package.json b/packages/utils/package.json index efbbf9b70..74815a042 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -29,7 +29,6 @@ }, "devDependencies": { "@types/debug": "^4.1.5", - "@types/resolve": "^1.14.0", - "memfs": "^3.1.2" + "@types/resolve": "^1.14.0" } } diff --git a/packages/utils/src/__mocks__/fs.js b/test/__mocks__/fs.js similarity index 100% rename from packages/utils/src/__mocks__/fs.js rename to test/__mocks__/fs.js diff --git a/yarn.lock b/yarn.lock index 1678d2d31..cadd5f0d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7282,7 +7282,7 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" -memfs@3.1.2, memfs@^3.1.2: +memfs@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.1.2.tgz#2bb51600dacec67ed35677b1185abb708b7d2ad6" integrity sha512-YubKuE+RGSdpZcRq2Nih8HcHj3LrqndsDFNB9IFjrgwzdM4eq+fImlDMfNm/HdRhYRkLdUecHGIpdz+wyrqlDg==