-
Notifications
You must be signed in to change notification settings - Fork 215
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
Vitest junit - Cannot read property 'time' of undefined #187
Comments
Running into the same problem: https://github.com/IntelliTect/Coalesce/runs/7960417153?check_suite_focus=true |
The readme is outdated, the following worked for me. my action yaml file name: "tests"
on:
pull_request:
push:
jobs:
build-test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
- run: npm ci
- run: npm run test-ci
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: JEST Tests
path: reports/jest-*.xml
reporter: jest-junit my package.json file {
// some other stuff...
"scripts": {
"test": "jest",
"test-ci": "jest --ci --reporters=default --reporters=jest-junit"
},
"dependencies": {
"@actions/core": "^1.9.1",
"@actions/exec": "^1.1.1",
"@types/command-exists": "^1.2.0",
"command-exists": "^1.2.9",
"esbuild": "^0.15.6",
"string-argv": "^0.3.1"
},
"devDependencies": {
"@types/jest": "^28.0.0",
"@types/node": "^18.7.9",
"jest": "^28.0.0",
"jest-junit": "^14.0.1",
"jest-junit-reporter": "^1.1.0",
"ts-jest": "^28.0.0",
"typescript": "^4.7.4"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node"
},
"jest-junit": {
"outputDirectory": "reports",
"outputName": "jest-junit.xml",
"ancestorSeparator": " › ",
"uniqueOutputName": "false",
"suiteNameTemplate": "{filepath}",
"classNameTemplate": "{classname}",
"titleTemplate": "{title}"
}
} |
@SamKirkland this issue is about vitest, not jest. |
I can't update my process to node 18, is there another solution that uses LTS? |
Has anyone found a solution to this? I'm running into the same issue. |
+1 on this |
+1 on this. I'm guessing this is failing on the root element Can the reporter please be updated to check for the attribute truthiness to handle the error a bit more gracefully? |
Yes please! According to the spec these attributes are optional, and vitest does not generate them. |
Looks like Vitest added support for these attributes here. |
Using Vitest I would specify the following configuration for my reporters:
Failed Output:
The text was updated successfully, but these errors were encountered: