Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: added unit test to their own git action #536

Merged
merged 2 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ jobs:
- name: Install
run: yarn --immutable

- name: Unit tests
run: yarn test

- name: Cypress run
# Uses the official Cypress GitHub action https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v5
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Unit tests
on:
pull_request:
branches:
- master
jobs:
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install
run: yarn --immutable

- name: Unit tests
run: yarn test
32 changes: 11 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,19 @@
"lint": "eslint src --max-warnings 24"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
"extends": ["react-app", "react-app/jest"]
},
"jest": {
"collectCoverage": true,
"collectCoverageFrom": [
"./src/utils/**"
],
"collectCoverageFrom": ["./src/**/*.js", "./src/**/*.ts"],
"coverageThreshold": {
"global": {
"lines": 20
"lines": 0
},
"./src/utils/": {
"lines": 23,
"branches": 29,
"functions": 33
}
},
"moduleNameMapper": {
Expand All @@ -114,16 +114,8 @@
}
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"production": [">0.2%", "not dead", "not op_mini all"],
"development": ["last 1 chrome version", "last 1 firefox version", "last 1 safari version"]
},
"resolutions": {
"react-error-overlay": "6.0.9"
Expand Down Expand Up @@ -187,9 +179,7 @@
"node": ">=16.0.0"
},
"nyc": {
"reporter": [
"html"
]
"reporter": ["html"]
},
"coverage": {
"min": 30
Expand Down
Loading