test-reporter icon indicating copy to clipboard operation
test-reporter copied to clipboard

No file found generated by mocha-json

Open ChAoSUnItY opened this issue 3 years ago • 2 comments

Here's my workflow looks like:

name: Eslint & Mocha test check

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [12.x, 14.x, 16.x]

    defaults:
      run:
        working-directory: ./CAScript-node-js-runtime

    steps:
    - uses: actions/checkout@v2
    - run: npm ci
    - run: npm run build --if-present
    - run: npm test
    - name: Test Report
      uses: dorny/test-reporter@v1
      if: success() || failure()
      with:
        name: Mocha Tests
        path: test-results.json
        reporter: mocha-json

and test command: mocha -r ts-node/register test/**/*.ts --reporter json > test-results.json

Am I doing any wrong?

ChAoSUnItY avatar Aug 21 '21 21:08 ChAoSUnItY

I am also seeing this issue

jpbogle avatar Feb 25 '22 20:02 jpbogle

the file definitely exists but maybe its parsing it wrong? I checked that it matches the format in the example output and it looks fine, using dorny/[email protected] and mocha 9.1.4

jpbogle avatar Feb 25 '22 20:02 jpbogle