Skip to content

Commit 2c8cd74

Browse files
committed
feat: allow test-command override
While lots of things can be achieved via npm run-scripts, it may be tricky to implement logic inside them in an OS-agnostic way.
1 parent 4267f00 commit 2c8cd74

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/node-test.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ on:
2323
required: false
2424
type: string
2525

26+
test-command:
27+
description: "Command to run instead of `npm test` (e.g. for coverage)."
28+
default: npm test
29+
required: false
30+
type: string
31+
2632
jobs:
2733

2834
prepare-node-matrix:
@@ -99,7 +105,7 @@ jobs:
99105

100106

101107
- name: Run tests
102-
run: npm test
108+
run: ${{ inputs.test-command }}
103109
env:
104110
MATRIX_NODE_VERSION: ${{ matrix.node-version }}
105111
NODE_LTS_LATEST: ${{ needs.prepare-node-matrix.outputs.lts-latest }}

0 commit comments

Comments
 (0)