diff --git a/dist/index.js b/dist/index.js index a352ed9..a3ceb63 100644 --- a/dist/index.js +++ b/dist/index.js @@ -336,7 +336,9 @@ const npmInstallAction = async () => { // that all promises that we care about have successfully // resolved, so simply exit with success. // From: https://github.com/actions/cache/blob/a2ed59d39b352305bdd2f628719a53b2cc4f9613/src/saveImpl.ts#L96 - process.exit(0) + if (process.env.NODE_ENV !== 'test') { + process.exit(0) + } } catch (err) { console.error(err) core.setFailed(err.message) diff --git a/index.js b/index.js index ef369b2..259155c 100644 --- a/index.js +++ b/index.js @@ -329,7 +329,9 @@ const npmInstallAction = async () => { // that all promises that we care about have successfully // resolved, so simply exit with success. // From: https://github.com/actions/cache/blob/a2ed59d39b352305bdd2f628719a53b2cc4f9613/src/saveImpl.ts#L96 - process.exit(0) + if (process.env.NODE_ENV !== 'test') { + process.exit(0) + } } catch (err) { console.error(err) core.setFailed(err.message) diff --git a/package.json b/package.json index 477c447..96d1b95 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "format": "prettier --write './**/*'", "format:check": "prettier --check './**/*'", - "test": "npm run unit", + "test": "NODE_ENV=test npm run unit", "unit": "mocha test/helper 'test/*spec.js'", "pretest": "npm run build", "build": "ncc build -o dist index.js",