Skip to content

Commit

Permalink
test: added unit test to their own git action (#536)
Browse files Browse the repository at this point in the history
* test: added unit test to their own git action

* test: adding more constraints
  • Loading branch information
kevkevinpal authored Nov 1, 2023
1 parent 23b063d commit db30981
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 24 deletions.
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

0 comments on commit db30981

Please sign in to comment.