add jest
This commit is contained in:
parent
426378f822
commit
d01fc6fb5c
|
@ -0,0 +1,33 @@
|
|||
export default {
|
||||
collectCoverageFrom: [
|
||||
"**/**/*.{ts,tsx}",
|
||||
"!**/**/*.test.{ts,tsx}",
|
||||
"!**/src/types/**",
|
||||
"!**/node_modules/**",
|
||||
"!**/dist/**",
|
||||
"!**/__tests__/**",
|
||||
],
|
||||
projects: [
|
||||
{
|
||||
clearMocks: true,
|
||||
resetMocks: true,
|
||||
restoreMocks: true,
|
||||
rootDir: ".",
|
||||
roots: ["<rootDir>/src"],
|
||||
transformIgnorePatterns: ["[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$"],
|
||||
displayName: {
|
||||
name: "@waku/react",
|
||||
color: "cyan",
|
||||
},
|
||||
testMatch: ["**/__tests__/**/*.(spec|test).ts?(x)"],
|
||||
transform: {
|
||||
"^.+\\.tsx?$": "@swc/jest",
|
||||
},
|
||||
testEnvironment: "jsdom",
|
||||
},
|
||||
],
|
||||
watchPlugins: [
|
||||
"jest-watch-typeahead/filename",
|
||||
"jest-watch-typeahead/testname",
|
||||
],
|
||||
};
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
|
@ -49,7 +49,8 @@
|
|||
"lint:fix": "npm run lint -- --fix",
|
||||
"prettier:fix": "prettier --config .prettierrc --write \"**/*.{js,ts,tsx}\"",
|
||||
"type": "tsc --noEmit",
|
||||
"test": "echo 0;",
|
||||
"test": "jest --config ./jest.config.js",
|
||||
"test:coverage": "npm run test -- --coverage",
|
||||
"prepublish": "npm run fix && npm run type && npm run test && npm run build"
|
||||
},
|
||||
"engines": {
|
||||
|
@ -62,7 +63,11 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "^24.0.1",
|
||||
"@swc/jest": "^0.2.24",
|
||||
"@testing-library/jest-dom": "^5.16.5",
|
||||
"@types/jest": "^29.4.0",
|
||||
"@types/react": "^18.0.28",
|
||||
"@types/testing-library__jest-dom": "^5.14.5",
|
||||
"@typescript-eslint/eslint-plugin": "^5.52.0",
|
||||
"@waku/interfaces": "^0.0.7",
|
||||
"eslint": "^8.34.0",
|
||||
|
@ -71,6 +76,9 @@
|
|||
"eslint-plugin-react": "^7.32.2",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||
"jest": "^29.4.3",
|
||||
"jest-environment-jsdom": "^29.4.3",
|
||||
"jest-watch-typeahead": "^2.2.2",
|
||||
"prettier": "^2.8.4",
|
||||
"rimraf": "^4.1.2",
|
||||
"rollup-plugin-peer-deps-external": "^2.2.4",
|
||||
|
|
Loading…
Reference in New Issue