Compare commits

...

3 Commits

Author SHA1 Message Date
gitea-actions 70758f1d74 chore: bump version [skip ci] 2026-06-05 20:44:36 +00:00
deac 395bf58622 add additional args to test npm runs
/ publish (push) Successful in 7s
2026-06-05 16:44:27 -04:00
gitea-actions 358bf3b06f chore: bump version [skip ci] 2026-06-01 00:51:33 +00:00
3 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
1.13.0
1.15.0
+10
View File
@@ -8,6 +8,7 @@ Composite action: install dependencies and run an npm test script.
|---|---|---|
| `INSTALL_CMD` | Install command | `npm ci` |
| `TEST_SCRIPT` | npm script to run (must exist in `package.json`) | `test` |
| `TEST_ARGS` | Additional arguments passed after `--` to the test script | `` |
| `WORKING_DIRECTORY` | Directory to run commands in | `.` |
## Usage
@@ -18,6 +19,15 @@ Composite action: install dependencies and run an npm test script.
TEST_SCRIPT: test:unit
```
With extra args:
```yaml
- uses: stat-tackler/stat-tackler-infra/test/npm@main
with:
TEST_SCRIPT: test:coverage
TEST_ARGS: --silent --reporter=dot --test-timeout=30000
```
### Common test scripts by project
| Project | Script | Runner |
+4 -1
View File
@@ -8,6 +8,9 @@ inputs:
TEST_SCRIPT:
description: "npm script to run (must exist in package.json)"
default: "test"
TEST_ARGS:
description: "Additional arguments to pass after -- to the test script"
default: ""
WORKING_DIRECTORY:
description: "Directory to run commands in"
default: "."
@@ -37,4 +40,4 @@ runs:
- name: Test
shell: sh
working-directory: ${{ inputs.WORKING_DIRECTORY }}
run: npm run ${{ inputs.TEST_SCRIPT }}
run: npm run ${{ inputs.TEST_SCRIPT }}${{ inputs.TEST_ARGS != '' && format(' -- {0}', inputs.TEST_ARGS) || '' }}