Skip to content

Error: ENOENT: no such file or directory jest.results.json  #8

@scurrilus-funke

Description

@scurrilus-funke

Hello @mattallty, I tried to use the Jest github-action as it is in the instructions. However, I get the following error every time. Can you please tell me what's going wrong here?

Best Peter

Run mattallty/jest-github-action@v1.0.24s
}
Run mattallty/jest-github-action@v1.0.2
Jest execution failed. Tests have likely failed.
Error: ENOENT: no such file or directory, open '/home/runner/work/_actions/mattallty/jest-github-action/v1.0.2/dist/jest.results.json'
    at Object.openSync (fs.js:440:3)
##[error]ENOENT: no such file or directory, open '/home/runner/work/_actions/mattallty/jest-github-action/v1.0.2/dist/jest.results.json'
    at Object.readFileSync (fs.js:342:35)
    at parseResults (/home/runner/work/_actions/mattallty/jest-github-action/v1.0.2/dist/index.js:1:24547)
    at Object.<anonymous> (/home/runner/work/_actions/mattallty/jest-github-action/v1.0.2/dist/index.js:1:21809)
    at Generator.next (<anonymous>)
    at fulfilled (/home/runner/work/_actions/mattallty/jest-github-action/v1.0.2/dist/index.js:1:20705)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/runner/work/_actions/mattallty/jest-github-action/v1.0.2/dist/jest.results.json'
}

My Github action in general is configured like this:

name: Jest Annotations & Coverage (Tests)
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
jobs:
  jest-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: '14.x'
          
      - run: yarn install

      - uses: mattallty/jest-github-action@v1.0.2
        if: github.event_name == 'pull_request'
        env: 
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with: 
          test-command: 'yarn test'
          changes-only: true
       
      - uses: mattallty/jest-github-action@v1.0.2
        if: github.event_name == 'push'
        env: 
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with: 
          test-command: 'yarn test'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions