diff --git a/.github/workflows/tests-js.yml b/.github/workflows/tests-js.yml index 08909a9..9a8c88f 100644 --- a/.github/workflows/tests-js.yml +++ b/.github/workflows/tests-js.yml @@ -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 diff --git a/README.md b/README.md index 77d15b0..11c224c 100644 --- a/README.md +++ b/README.md @@ -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: