Skip to content

Commit

Permalink
Config jest, testing/library install & setup
Browse files Browse the repository at this point in the history
  • Loading branch information
WooWan committed Oct 15, 2022
1 parent ed864e1 commit c6e6c3e
Show file tree
Hide file tree
Showing 3 changed files with 2,137 additions and 41 deletions.
19 changes: 19 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// jest.config.js
const nextJest = require('next/jest')

const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: './',
})

// Add any custom config to be passed to Jest
const customJestConfig = {
// Add more setup options before each test is run
// setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
// if using TypeScript with a baseUrl set to the root directory then you need the below for alias' to work
moduleDirectories: ['node_modules', '<rootDir>/'],
testEnvironment: 'jest-environment-jsdom',
}

// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
module.exports = createJestConfig(customJestConfig)
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@tanstack/react-query": "^4.0.10",
"@tanstack/react-query-devtools": "^4.2.3",
"@toast-ui/react-editor": "^3.2.0",
"axios": "^0.27.2",
"axios": "^1.1.2",
"cross-env": "^7.0.3",
"framer-motion": "^6.5.1",
"next": "12.2.3",
Expand All @@ -29,6 +29,8 @@
"styled-components": "^5.3.5"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@types/node": "18.6.3",
"@types/react": "18.0.15",
"@types/react-datepicker": "^4.4.2",
Expand All @@ -39,6 +41,8 @@
"eslint": "8.21.0",
"eslint-config-next": "12.2.3",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.2.0",
"jest-environment-jsdom": "^29.2.0",
"typescript": "4.7.4"
}
}
Loading

1 comment on commit c6e6c3e

@vercel
Copy link

@vercel vercel bot commented on c6e6c3e Oct 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

escaper-front – ./

escaper-front-git-main-woowan.vercel.app
escaper-front-woowan.vercel.app
escapering.vercel.app

Please sign in to comment.