Add Jest setup for unit testing (#731)

* install jest

* rename test script name

* test Safari detection logic

* don't expose implementation details for testing

* fix jest config

* contrib build

* don't expose impl details for testing
main
souppower 6 years ago committed by Michael Fix
parent 4d2b212f69
commit 36b582cc60

@ -481,6 +481,15 @@
"contributions": [
"code"
]
},
{
"login": "souppower",
"name": "souppower",
"avatar_url": "https://avatars2.githubusercontent.com/u/19849611?v=4",
"profile": "https://github.com/souppower",
"contributions": [
"infra"
]
}
],
"repoType": "github"

@ -0,0 +1,3 @@
{
"presets": ["next/babel"]
}

@ -4,7 +4,7 @@ module.exports = {
browser: true,
es6: true,
node: true,
mocha: true
jest: true
},
extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:jsx-a11y/recommended'],
parserOptions: {

1
.gitignore vendored

@ -7,3 +7,4 @@ cypress/screenshots
.idea
.DS_Store
packaged
coverage

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -8,7 +8,8 @@
"build": "next build",
"start": "next start",
"export": "next export",
"test": "npm run cy:run --",
"test": "jest",
"test:e2e": "npm run cy:run --",
"deploy": "now",
"prettier": "prettier --config .prettierrc --write {.,components,lib,pages}/*.js {components,lib,pages,packages}/**/*.js",
"lint": "eslint .",
@ -62,6 +63,7 @@
"eslint-plugin-react": "^7.12.3",
"eslint-plugin-react-hooks": "^1.4.0",
"husky": "^1.3.1",
"jest": "^24.7.1",
"lint-staged": "^8.1.3",
"now": "^15.0.0",
"wait-on": "^3.2.0"

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save