Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/tests-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,13 @@ jobs:
- name: Run frontend tests
if: ${{ inputs.js-working-directory != '' }}
working-directory: ${{ inputs.js-working-directory }}
run: npm test
env:
WORKING_DIR: ${{ inputs.js-working-directory }}
CI: true
run: |
if [ -f "${{ github.workspace }}/run-js-tests.sh" ]; then
${{ github.workspace }}/run-js-tests.sh
else
echo "Warning: run-js-tests.sh not found, falling back to 'npm test'"
npm test
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ This workflow will:
3. Run the linter using the `./run-js-linter.sh` script in the repository.
4. Install test dependencies if the `js-working-directory` input is set.
5. Install frontend dependencies if the `translations-working-directory` input is set.
6. Run the tests using the `./run-js-tests.sh` script in the repository.
6. Run the tests using the `./run-js-tests.sh` script in the repository (falls back to `npm test` if not present).

To use in your repository, add the following in your `.github/workflows/tests.yml` file under the `jobs` key:

Expand Down