Skip to content

Commit

Permalink
feat: add unit tests report to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
sashtje committed Oct 1, 2023
1 parent 683b6f8 commit 0d8bade
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,23 @@ jobs:
- name: Screenshot testing
if: always()
run: npm run test:ui:ci
- name: Unit testing
if: always()
run: npm run test:unit
- name: Generate HTML report
if: always()
run: npm run test:ui:report
- name: Move loki
if: always()
run: mv .loki reports/
- name: Setup Pages
if: always()
uses: actions/configure-pages@v2
- name: Upload artifact
if: always()
uses: actions/upload-pages-artifact@v1
with:
path: '.loki'
path: 'reports'
- name: Deploy to GitHub Pages
id: deployment
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ node_modules/
/storybook-static
.loki/report.html
.loki/report.json
/reports
/reports/unit
2 changes: 1 addition & 1 deletion config/jest/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default {
'jest-html-reporters', {
publicPath: '<rootDir>/reports/unit',
filename: 'report.html',
openReport: true,
// openReport: true,
inlineSource: true,
},
],
Expand Down
15 changes: 15 additions & 0 deletions reports/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Tests Reports</title>
</head>
<body>
<a href="./unit/report.html">Unit Tests Report</a>
<hr>
<a href=".loki/report.html">Screenshot Tests Report</a>
</body>
</html>

0 comments on commit 0d8bade

Please sign in to comment.