File tree 4 files changed +2547
-112
lines changed
4 files changed +2547
-112
lines changed Original file line number Diff line number Diff line change
1
+ const nextJest = require ( "next/jest" ) ;
2
+ const createJestConfig = nextJest ( {
3
+ dir : "./"
4
+ } ) ;
5
+ const customJestConfig = {
6
+ moduleDirectories : [ "node_modules" , "<rootDir>" ] ,
7
+ setupFilesAfterEnv : [ "<rootDir>/jest.setup.js" ] ,
8
+ testEnvironment : "jest-environment-jsdom" ,
9
+ extensionsToTreatAsEsm : [ ".ts" ]
10
+ // transformIgnorePatterns: ["/node_modules/(?!(foo|bar)/)"]
11
+ } ;
12
+ module . exports = createJestConfig ( customJestConfig ) ;
Original file line number Diff line number Diff line change
1
+ // Optional: configure or set up a testing framework before each test.
2
+ // If you delete this file, remove `setupFilesAfterEnv` from `jest.config.js`
3
+
4
+ // Used for __tests__/testing-library.js
5
+ // Learn more: https://github.com/testing-library/jest-dom
6
+ import "@testing-library/jest-dom/extend-expect" ;
Original file line number Diff line number Diff line change 6
6
"dev" : " next dev" ,
7
7
"build" : " next build" ,
8
8
"start" : " next start" ,
9
- "lint" : " next lint"
9
+ "lint" : " next lint" ,
10
+ "test" : " jest --watch" ,
11
+ "test:ci" : " jest --ci"
10
12
},
11
13
"dependencies" : {
12
14
"@types/node" : " 18.11.9" ,
16
18
"eslint-config-next" : " 13.0.5" ,
17
19
"gray-matter" : " ^4.0.3" ,
18
20
"highlight.js" : " ^11.7.0" ,
19
- "nanoid" : " ^4.0.0" ,
20
21
"next" : " 13.0.5" ,
21
22
"next-mdx-remote" : " ^4.2.0" ,
22
23
"react" : " 18.2.0" ,
23
24
"react-dom" : " 18.2.0" ,
24
25
"rehype-highlight" : " ^6.0.0" ,
25
- "typescript" : " 4.9.3"
26
+ "typescript" : " 4.9.3" ,
27
+ "uuid" : " ^9.0.0"
28
+ },
29
+ "devDependencies" : {
30
+ "@testing-library/jest-dom" : " ^5.16.5" ,
31
+ "@testing-library/react" : " ^13.4.0" ,
32
+ "@testing-library/user-event" : " ^14.4.3" ,
33
+ "@types/jest" : " ^29.2.4" ,
34
+ "@types/uuid" : " ^9.0.0" ,
35
+ "jest" : " ^29.3.1" ,
36
+ "jest-environment-jsdom" : " ^29.3.1"
26
37
}
27
38
}
You can’t perform that action at this time.
0 commit comments