Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
56
rated 0 times [  60] [ 4]  / answers: 1 / hits: 23120  / 6 Years ago, tue, may 29, 2018, 12:00:00

I have setup jest and jest-junit as the reporter and followed the simple instructions given by jest-junit.



This includes npm install jest --save-dev and npm install jest-junit --save-dev



My package.json looks like this (excerpt):



  devDependencies: { 
jest: ^22.4.4,
jest-junit: ^4.0.0,
},
scripts: {
test: jest --ci --testResultsProcessor='jest-junit'
},
jest: {
verbose: true,
testResultsProcessor: jest-junit
},
jest-junit: {
suiteName: Test Suite,
output: ./junit.xml
}


When running npm run test on my machine (OSX), it works well. When running it as part of the CI build process or on another Windows machine, I am getting the following error:



Module 'jest-junit' in the testResultsProcessor option was not found.


More From » jestjs

 Answers
11

Found the solution and it was the removal of inverted commas.



test: jest --ci --testResultsProcessor='jest-junit'


should become



test: jest --ci --testResultsProcessor=jest-junit

[#54321] Friday, May 25, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
davism

Total Points: 339
Total Questions: 100
Total Answers: 100

Location: Sweden
Member since Fri, Apr 16, 2021
3 Years ago
;