Skip to content

Commit

Permalink
Merge pull request #73 from equisoft-actions/dev/QCTECH-1317
Browse files Browse the repository at this point in the history
feat(php-app): support jest as frontend test runner
  • Loading branch information
meriouma authored May 6, 2024
2 parents 0f515cf + 52d9f9a commit 8e18dca
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/php-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ jobs:
- name: Run stylelint
uses: equisoft-actions/yarn-stylelint@v1

mocha:
name: Mocha
js-tests:
name: JS unit tests
needs:
- pre-checks
- setup
Expand All @@ -492,6 +492,12 @@ jobs:
uses: equisoft-actions/with-asdf-vm@v2
if: ${{ needs.setup.outputs.with-asdf == 'true' }}

- name: Detect test runner
id: test-runner
shell: bash
run:
echo "use-jest=$(jq -e '.devDependencies | has("jest")' package.json)" >> $GITHUB_OUTPUT

- name: NPM Login
uses: equisoft-actions/yarn-npm-login@v1
with:
Expand All @@ -502,8 +508,13 @@ jobs:
uses: equisoft-actions/yarn-install@v1

- name: Run Mocha
if: ${{ steps.test-runner.outputs.use-jest == 'false' }}
uses: equisoft-actions/yarn-mocha@v1

- name: Run Jest
if: ${{ steps.test-runner.outputs.use-jest == 'true' }}
uses: equisoft-actions/yarn-jest@v1

yaml_validate:
name: Yaml validation
needs:
Expand Down Expand Up @@ -673,7 +684,7 @@ jobs:
- phpunit-it
- eslint
- stylelint
- mocha
- js-tests
- yaml_validate
- build_backend
- build_frontend
Expand Down Expand Up @@ -895,7 +906,7 @@ jobs:
- generate_sdk
- eslint
- stylelint
- mocha
- js-tests
- yaml_validate
- build_backend
- build_frontend
Expand Down

0 comments on commit 8e18dca

Please sign in to comment.