From 5df02f09333ae5e1967372ad9d551bdf064812ba Mon Sep 17 00:00:00 2001 From: modesty Date: Mon, 29 Apr 2024 13:56:20 -0700 Subject: [PATCH] build: log process.exit code from jest test --- .github/workflows/ci.yml | 6 +++++- jest.config.json | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43fccb92..8011f00b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,10 @@ jobs: uses: actions/github-script@v6 with: script: | - core.setFailed('Tests failed. Please fix errors before merging.'); + console.log('Exit code:', core.getInput('result')); + if (core.getInput('result') !== '0') { + core.setFailed('Tests failed. Please fix errors before merging.'); + } + result: ${{ jobs.build.outputs.test-result }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/jest.config.json b/jest.config.json index 9abf8a9b..2457cddc 100644 --- a/jest.config.json +++ b/jest.config.json @@ -1,4 +1,6 @@ { "testMatch": ["**/test/_test_.*"], - "testEnvironment": "node" + "testEnvironment": "node", + "bail": false, + "testFailureExitCode": 1 }