1.0.0 • Published 3 years ago
@hannohealth/jest-csv-reporter v1.0.0
jest-csv-reporter
Reporter plugin for Jest that writes test results to a CSV file.
The CSV output format is as follows:
"Test Name","Path","Result"
"Example test name","/src/__tests__/example.test.js","passed"
Installation
npm install --save-dev @hannohealth/jest-csv-reporter
yarn add -D @hannohealth/jest-csv-reporter
Usage
Add the following to your Jest configuration file, e.g. jest.config.js
:
reporters: [
'default',
[
'@hannohealth/jest-csv-reporter',
{
outputDir: 'reports' // default
outputFile: 'test.csv', // overwrite the default: 'test-report-unit.csv'
},
],
],
Development
- Run
yarn test
to run unit tests and generate the CSV test report inreports
License
MIT
1.0.0
3 years ago