Skip to content

Commit

Permalink
feat: Setup tests with testing library
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlucss committed Jun 23, 2021
1 parent 713a5f6 commit 5aec389
Show file tree
Hide file tree
Showing 4 changed files with 2,224 additions and 27 deletions.
7 changes: 7 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
testPathIgnorePatterns: ["<rootDir>/.next/", "<rootDir>/node_modules/"],
setupFilesAfterEnv: ["<rootDir>/setupTests.js"],
transform: {
"^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest"
}
};
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
"start": "next start",
"test": "jest --passWithNoTests"
},
"dependencies": {
"@carbon/icons-react": "^10.28.0",
Expand All @@ -21,8 +22,14 @@
"styled-components": "^5.2.1"
},
"devDependencies": {
"@testing-library/dom": "^8.0.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.6",
"babel-jest": "^27.0.5",
"eslint": "^7.22.0",
"eslint-plugin-react": "^7.22.0",
"jest": "^27.0.5",
"jest-dom": "^4.0.0",
"sass": "^1.32.8"
}
}
1 change: 1 addition & 0 deletions setupTests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "@testing-library/jest-dom/extend-expect";
Loading

0 comments on commit 5aec389

Please sign in to comment.