Skip to content

Commit

Permalink
Allow callers to customize CLI options for test runner
Browse files Browse the repository at this point in the history
Some projects use Jest for test coverage and some use the builtin
Node.js test runner. The two frameworks accept different CLI
options. Allow the calling workflow to customize the CLI options
for the test runner.

See nasa-gcn/architect-plugin-search#45.
  • Loading branch information
lpsinger committed Jul 2, 2024
1 parent 492c6d6 commit a29d1b0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Build and test Node.js

on:
workflow_call:
inputs:
test-options:
description: Arguments to pass to test runner
default: --coverage
required: false
type: string

jobs:
matrix:
Expand Down Expand Up @@ -38,6 +44,6 @@ jobs:
# See https://prettier.io/docs/en/options.html#end-of-line
if: ${{ runner.os != 'Windows' }}
- name: Run unit tests
run: npm test --if-present -- --coverage
run: npm test --if-present -- ${{ inputs.test-options }}
- name: Upload to Codecov.io
uses: codecov/codecov-action@v3

0 comments on commit a29d1b0

Please sign in to comment.