Files
gitea-actions/test/npm/README.md
T
2026-06-05 16:44:27 -04:00

40 lines
1.0 KiB
Markdown

# test/npm
Composite action: install dependencies and run an npm test script.
## Inputs
| Input | Description | Default |
|---|---|---|
| `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
```yaml
- uses: stat-tackler/stat-tackler-infra/test/npm@main
with:
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 |
|---|---|---|
| `stat-tackler-api` | `test` | Jest |
| `stat-tackler-scorekeeper` | `test:unit` | Vitest |
| `stat-tackler-scorekeeper` | `test:integration` | Vitest |
| `stat-tackler-scorekeeper` | `test:run` | Vitest (unit + integration) |
| `stat-tackler-scorekeeper` | `test:coverage` | Vitest |