From 3d3dd7a8cf1b8a7e9d0d16904a5a6159b652dda7 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Wed, 15 Apr 2026 16:17:11 +0200 Subject: [PATCH] feat(tests-js): support run-js-tests.sh script with fallback * Adds support for consuming repositories to provide run-js-tests.sh script at repo root * Falls back to npm test if script not present, maintaining backward compatibility * Passes WORKING_DIR and CI environment variables to the script * Addresses RFC 112 for react upgrade --- .github/workflows/tests-js.yml | 11 ++++++++++- README.md | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) 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: