Skip to content

Action failing due to Cannot read properties of undefined (reading 'numFailedTests') error #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Metaphysics0 opened this issue Jan 15, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Metaphysics0
Copy link

Metaphysics0 commented Jan 15, 2025

Describe a bug

the action is failing due to

Error: TypeError: Cannot read properties of undefined (reading 'numFailedTests')

this error gets printed very shortly after the generating report log.

I can run the command just fine:

npx --ci --json --coverage --testLocationInResults --outputFile=report.json

and the report.json gets added to the root directory of my project with the correct fields.

Screenshot 2025-01-15 at 17 42 18

Expected behavior

Not getting the numFailedTest logs

Details

  • Action version: latest (v2.3.1)
  • OS, where your action is running (windows, linux): linux
  • yaml file here: https://pastebin.com/2KWQAA1B (see the coverage-report item)
@Metaphysics0 Metaphysics0 added the bug Something isn't working label Jan 15, 2025
@alexmdodge
Copy link

alexmdodge commented Jan 21, 2025

Ran into similar troubles, but it just looks like it's a change in whatever the defacto cached node version was on the GitHub runners. Fixed by just being explicit about what node version should be used:

name: 'Jest Coverage Report'
on:
    pull_request:
        branches:
            - main
   
jobs:
    coverage:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v3
            - uses: actions/setup-node@v2
              with:
                node-version: 'lts/hydrogen'
                cache: 'npm'
            - uses: ArtiomTr/jest-coverage-report-action@v2
              with:
                test-script: npm run test -- --ci

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants