Skip to content
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

Not working with projects? #68

Closed
rattrayalex-stripe opened this issue Oct 19, 2018 · 3 comments
Closed

Not working with projects? #68

rattrayalex-stripe opened this issue Oct 19, 2018 · 3 comments

Comments

@rattrayalex-stripe
Copy link

Hi,

Jest now has the ability to specify multiple projects: https://jestjs.io/docs/en/configuration.html#projects-array-string-projectconfig

When I try to use this with jest-junit, I don't seem to have any junit files generated. No errors are thrown.

As a workaround, I'm running each project separately in CI with --config settings, eg;

// package.json: 
"jest": {
  "projects": ["foo.jest.config.js", "bar.jest.config.js"]
}

// ci script: 
JEST_JUNIT_OUTPUT=foo-tests.xml yarn jest --config foo.jest.config.js
JEST_JUNIT_OUTPUT=bar-tests.xml yarn jest --config bar.jest.config.js

// in development
yarn jest // runs both foo and bar

I haven't done any digging into why this may be happening.

Do you think this can be fixed?

@SimenB
Copy link
Member

SimenB commented Oct 19, 2018

I think this is related to jestjs/jest#5441

@rattrayalex-stripe
Copy link
Author

Seems pretty plausible; thanks @SimenB . Looks like that's been aging for a while without a concrete plan for action; sounds a little tricky.

@palmerj3
Copy link
Collaborator

jest-junit itself does not rely on globalSetup or globalTeardown. But reporters are configured globally, not on a per-project basis. So I would suggest having a top level jest config that specifies the projects and the reporter(s) you want to use. Or specify the reporters via cli args.

At Spotify jest-junit is used widely with multiple project jest configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants