Skip to content

Commit 6652006

Browse files
feat: Adding react testing library & jest (#100)
1 parent 91e9cc6 commit 6652006

File tree

6 files changed

+21421
-11970
lines changed

6 files changed

+21421
-11970
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ module.exports = {
1515
env: {
1616
browser: true, // Enables browser globals like window and document
1717
amd: true, // Enables require() and define() as global variables as per the amd spec.
18-
node: true // Enables Node.js global variables and Node.js scoping.
18+
node: true, // Enables Node.js global variables and Node.js scoping.
19+
jest: true
1920
},
2021
extends: [
2122
"eslint:recommended",

jest.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
setupFilesAfterEnv: ["./jest.setup.js"],
3+
moduleNameMapper: {
4+
"^@components(.*)$": "<rootDir>/components$1",
5+
"^@pages(.*)$": "<rootDir>/pages$1",
6+
"^@projects(.*)$": "<rootDir>/projects$1"
7+
}
8+
};

jest.setup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import "@testing-library/jest-dom";

jsconfig.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
{
2-
"compilerOptions": {
3-
"baseUrl": ".",
4-
"paths": {
5-
"@components/*": ["components/*"],
6-
"@projects/*": ["projects/*"]
7-
}
8-
}
2+
"compilerOptions": {
3+
"baseUrl": ".",
4+
"paths": {
5+
"@components/*": [
6+
"components/*"
7+
],
8+
"@pages/*": [
9+
"pages/*"
10+
],
11+
"@projects/*": [
12+
"projects/*"
13+
]
14+
}
15+
}
916
}

0 commit comments

Comments
 (0)