Add Jest setup to site

This commit is contained in:
Rickard Natt och Dag 2021-02-05 14:54:59 +01:00
parent 4bf37101ec
commit 7bca0b2028
No known key found for this signature in database
GPG Key ID: C3958EFC7F24E8DF
6 changed files with 4532 additions and 4 deletions

3
packages/site/.babelrc Normal file
View File

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

View File

@ -9,6 +9,7 @@ plugins:
env:
browser: true
node: true
jest: true
settings:
react:
version: "detect"

View File

@ -0,0 +1 @@
export default "test-file-mock";

View File

@ -0,0 +1,12 @@
module.exports = {
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js',
'\\.(css|scss)$': 'identity-obj-proxy',
},
}

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
{
"name": "jironis-react-next",
"name": "skolplattformen-site",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
@ -21,14 +21,23 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint './**/*.js'"
"lint": "eslint './**/*.js'",
"test": "is-ci test:ci test:watch",
"test:ci": "jest",
"test:watch": "jest --watch"
},
"devDependencies": {
"@testing-library/jest-dom": "5.11.9",
"@testing-library/react": "11.2.5",
"babel-eslint": "10.1.0",
"eslint": "7.19.0",
"eslint-config-prettier": "7.2.0",
"eslint-plugin-prettier": "3.3.1",
"eslint-plugin-react": "7.22.0",
"identity-obj-proxy": "3.0.0",
"is-ci-cli": "2.2.0",
"jest": "26.6.3",
"jest-watch-typeahead": "0.6.1",
"prettier": "2.2.1"
}
}