Commit d0e4aa83 authored by Lynn's avatar Lynn Committed by GitHub

fix: add jest coverage config to package.json (#3896)

* fix: add jest coverage config to package.json

* fix: add running test instructions to CONTRIBUTING.md

* fix: respond to zzmp comments

* fix: lower test thresholds
Co-authored-by: default avatarLynn Yu <lynn.yu@uniswap.org>
parent b17a38d9
# Contributing
Thank you for your interest in contributing to the Uniswap interface! 🦄
......@@ -15,6 +14,16 @@ Thank you for your interest in contributing to the Uniswap interface! 🦄
1. `yarn install`
1. `yarn build`
## Running unit tests
- Run unit tests: `yarn test`
- Run unit tests and show test coverage info for all tests: `yarn test --watchAll`
## Running cypress integration tests
1. `yarn build:e2e`
2. `yarn test:e2e`
## Engineering standards
Code merged into the `main` branch of this repository should adhere to high standards of correctness and maintainability.
......
......@@ -16,11 +16,32 @@
"prepare": "yarn contracts:compile && yarn graphql:generate && yarn i18n:compile",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"test": "react-scripts test --coverage",
"build:e2e": "env-cmd -f .env yarn build",
"test:e2e": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress open'",
"test:e2e:ci": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress run --record'"
},
"jest": {
"collectCoverageFrom":
[
"src/components/**/*.ts*",
"src/hooks/**/*.ts*",
"src/lib/hooks/**/*.ts*",
"src/lib/state/**/*.ts*",
"src/lib/utils/**/*.ts*",
"src/pages/**/*.ts*",
"src/state/**/*.ts*",
"src/utils/**/*.ts*"
],
"coverageThreshold": {
"global": {
"branches": 4,
"functions": 6,
"lines": 9,
"statements": 9
}
}
},
"browserslist": {
"production": [
">0.2%",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment