Skip to content

Commit

Permalink
feat: add html reporter for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TomatoVan committed Feb 19, 2024
1 parent c209143 commit 599e38d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ node_modules
/.package-lock.json
/storybook-static/project.json
/storybook-static/favicon.ico
/reports
/reports/unit/report.html



Expand Down
10 changes: 10 additions & 0 deletions config/jest/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ export default {
'\\.s?css$': 'identity-obj-proxy',
'\\.svg': path.resolve(__dirname, 'jestEmptyComponent.tsx'),
},
reporters: [
'default',
['jest-html-reporters', {
publicPath: '<rootDir>/reports/unit',
filename: 'report.html',
openReport: true,
inlineSource: true,
}],
],

// Indicates whether the coverage information should be collected while executing the test
// collectCoverage: false,

Expand Down
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
"webpack": "^5.69.1",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4"
"webpack-dev-server": "^4.7.4",
"jest-html-reporters": "^3.0.10"
},
"dependencies": {
"@reduxjs/toolkit": "^1.8.0",
Expand Down

0 comments on commit 599e38d

Please sign in to comment.