alwaysabeginner
alwaysabeginner

Reputation: 217

How to override the default jest-junit output file name - junit.xml

I am running a test using jest-junit and I want to change the default name of the output file which is junit.xml. I don't want to specify the outputname in the package.json or jest.config but instead I want to specify it in the ci something like

npx jest --ci --testResultsProcessor="jest-junit" --outputName="test.xml"

But this is still giving the output file as junit.xml. Is there something missing here?

Upvotes: 3

Views: 3278

Answers (1)

alwaysabeginner
alwaysabeginner

Reputation: 217

Never mind, I achieved that by passing the file name to the environment variable JEST_JUNIT_OUTPUT_NAME.

ref- https://www.npmjs.com/package/jest-junit

Upvotes: 1

Related Questions