actions / typescript-action

Create a TypeScript Action with tests, linting, workflow, publishing, and versioning
https://github.com/actions
MIT License
2k stars 473 forks source link

"npm test" script eats failure-status (because "|| make-coverage-badge") #799

Closed ebrannin-bw closed 11 months ago

ebrannin-bw commented 11 months ago

The npm test script eats failures, and breaks && in npm run all:

{
    "test": "(jest && make-coverage-badge --output-path ./badges/coverage.svg) || make-coverage-badge --output-path ./badges/coverage.svg",
    "all": "npm run format:write && npm run lint && npm run test && npm run package"
}

Because it runs make-coverage-badge on test failure, when I run npm run all it will run npm run package even if tests fail.

ebrannin-bw commented 11 months ago

This also breaks VS Code's Jest integration, because it expects to run npm test -- --flag ... and have the new arguments go to Jest.

I've fixed it in my repo by:

ncalteen commented 11 months ago

Hey @ebrannin-bw, thanks for catching that! I've submitted #805 to fix this error using the workaround you provided :)