-
Notifications
You must be signed in to change notification settings - Fork 109
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
Getting "extra" testcases, one "correct", another with just a Test Execution Failure #220
Comments
Downgrading to v13.2.0 seems to fix the issue. |
azzlack
added a commit
to azzlack/jest-junit
that referenced
this issue
Aug 24, 2022
You'll need to use "false" instead of false for the parameters.
This is not ideal or intuitive, I agree. But it's for compatibility across
the various ways you are able to set options with jest-junit.
So I think what is happening is that you've inadvertently turned the
feature on. Should work all the same if you just remove
the reportTestSuiteErrors configuration line.
If that doesn't work let me know and I can push a fix.
…On Wed, Aug 24, 2022 at 12:47 PM Ove Andersen ***@***.***> wrote:
I'm getting some weird test results when using this.
I get one ESlint testcase that represents the file itself, that is
successful - and one testcase for the same file with just an error Test
execution failure: could be caused by test hooks like 'afterAll'.
# .eslintrc.jsmodule.exports = {
root: true,
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
},
parser: ***@***.***/parser',
plugins: ***@***.***', 'tailwindcss'],
extends: ['eslint:recommended', ***@***.***/recommended', 'plugin:tailwindcss/recommended', 'prettier', 'next/core-web-vitals'],
ignorePatterns: ["dist/", "node_modules/", ".turbo/", ".next/"],
rules: {
***@***.***/next/no-html-link-for-pages': 'off',
'react/jsx-key': 'off',
"react/jsx-max-depth": ["error", { "max": 8 }],
"react/forbid-component-props": ["error", { "forbid": ['style'] }]
}};
# jest.config.jsconst fs = require('fs');
const getPackageName = () => {
packagejson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
return packagejson.name;}
module.exports = {
projects: [
{
displayName: 'test'
},
{
displayName: 'lint',
runner: 'jest-runner-eslint',
testPathIgnorePatterns: ["/node_modules/", "dist/", ".storybook/", "storybook-static/", ".next/", "build/"],
testMatch: ['<rootDir>/**/*.{js,ts,tsx}']
}
],
cacheDirectory: "<rootDir>/../../.jestcache",
reporters: ["default", ["jest-junit", {
outputDirectory: "<rootDir>/../../.testresults",
outputName: `junit-${getPackageName()}.xml`,
reportTestSuiteErrors: false,
includeConsoleOutput: false
}]],
collectCoverage: true,
coverageReporters: [["cobertura", { file: `cobertura-coverage-${getPackageName()}.xml` }]],
coverageDirectory: "<rootDir>/../../.testresults"}
Running jest --ci then yields the following result:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="jest tests" tests="5" failures="0" errors="0" time="2.047">
<testsuite name="undefined" errors="0" failures="0" skipped="0" timestamp="2022-08-24T13:18:16" time="1.338" tests="1">
<testcase classname=" ESLint" name=" ESLint" time="1.338">
</testcase>
<testcase classname=" Test execution failure: could be caused by test hooks like 'afterAll'." name=" Test execution failure: could be caused by test hooks like 'afterAll'." time="0">
<failure>null</failure>
</testcase>
</testsuite>
<testsuite name="undefined" errors="0" failures="0" skipped="0" timestamp="2022-08-24T13:18:16" time="1.338" tests="1">
<testcase classname=" ESLint" name=" ESLint" time="1.338">
</testcase>
<testcase classname=" Test execution failure: could be caused by test hooks like 'afterAll'." name=" Test execution failure: could be caused by test hooks like 'afterAll'." time="0">
<failure>null</failure>
</testcase>
</testsuite>
<testsuite name="undefined" errors="0" failures="0" skipped="0" timestamp="2022-08-24T13:18:16" time="1.34" tests="1">
<testcase classname=" ESLint" name=" ESLint" time="1.34">
</testcase>
<testcase classname=" Test execution failure: could be caused by test hooks like 'afterAll'." name=" Test execution failure: could be caused by test hooks like 'afterAll'." time="0">
<failure>null</failure>
</testcase>
</testsuite>
<testsuite name="undefined" errors="0" failures="0" skipped="0" timestamp="2022-08-24T13:18:16" time="1.572" tests="1">
<testcase classname=" ESLint" name=" ESLint" time="1.572">
</testcase>
<testcase classname=" Test execution failure: could be caused by test hooks like 'afterAll'." name=" Test execution failure: could be caused by test hooks like 'afterAll'." time="0">
<failure>null</failure>
</testcase>
</testsuite>
<testsuite name="undefined" errors="0" failures="0" skipped="0" timestamp="2022-08-24T13:18:16" time="1.574" tests="1">
<testcase classname=" ESLint" name=" ESLint" time="1.574">
</testcase>
<testcase classname=" Test execution failure: could be caused by test hooks like 'afterAll'." name=" Test execution failure: could be caused by test hooks like 'afterAll'." time="0">
<failure>null</failure>
</testcase>
</testsuite>
</testsuites>
Originally posted at jest-community/jest-runner-eslint#141
<jest-community/jest-runner-eslint#141>, but
seems like the issue is with this package.
—
Reply to this email directly, view it on GitHub
<#220>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAEQR3U3EUXI6ZBLVRDE63V2ZG25ANCNFSM57QBL5QA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I removed them, without any difference. As you can see from the PR, the issue is with how jest-junit deals with null vs undefined in 14.0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm getting some weird test results when using this.
I get one ESlint testcase that represents the file itself, that is successful - and one testcase for the same file with just an error
Test execution failure: could be caused by test hooks like 'afterAll'.
Running
jest --ci
then yields the following result.(Please note that the failing testcases are not present in the console output, or in the junit output)
Originally posted at jest-community/jest-runner-eslint#141, but seems like the issue is with this package.
The text was updated successfully, but these errors were encountered: