From 418e40ac63f837909bba20125f7a44eb07209c15 Mon Sep 17 00:00:00 2001 From: abetomo Date: Sat, 5 Feb 2022 10:24:40 +0900 Subject: [PATCH] test: fix error with npm8 ``` packageJson.optionalDependencies = { npm: '*' } ``` The reason seems to be that the contents of 'package.json' and 'package-lock.json' do not match according to the above. Removing package-lock.json will not affect the validity of this test. --- test/main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/main.js b/test/main.js index 617b045..ad90ea3 100644 --- a/test/main.js +++ b/test/main.js @@ -740,6 +740,9 @@ describe('lib/main', function () { const packageJson = require(packageJsonPath) packageJson.optionalDependencies = { npm: '*' } fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson)) + + // Remove package-lock.json because it does not match the package.json to which optionalDependencies was added. + fs.removeSync(path.join(codeDirectory, 'package-lock.json')) } const testOptionalDependenciesIsInstalled = async (packageManager) => {