Skip to content

Commit

Permalink
Try to get Jest working without breaking Parcel
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec committed Mar 1, 2024
1 parent 1bc5d35 commit 2122ffa
Show file tree
Hide file tree
Showing 7 changed files with 372 additions and 1,664 deletions.
9 changes: 9 additions & 0 deletions .parcel.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "@parcel/config-default",
"transformers": {
"*.{js,mjs,jsx,cjs,ts,tsx}": [
"@parcel/transformer-js",
"@parcel/transformer-react-refresh-wrap"
]
}
}
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { presets: ["@babel/preset-env", "@babel/preset-typescript"] };
7 changes: 7 additions & 0 deletions no.jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
preset: "ts-jest",
transform: {
"^.+\\.tsx?$": "ts-jest",
"^.+\\.jsx?$": "babel-jest",
},
};
1,993 changes: 339 additions & 1,654 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,18 @@
"validator": "^13.11.0"
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/preset-env": "^7.24.0",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@parcel/packager-raw-url": "^2.12.0",
"@parcel/transformer-webmanifest": "^2.12.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.2",
"@types/crypto-js": "^4.1.3",
"@types/css-mediaquery": "^0.1.2",
"@types/jest": "^29.5.5",
"@types/loadable__component": "^5.13.8",
"@types/node": "^20.10.6",
"@types/nspell": "^2.1.5",
Expand All @@ -108,7 +111,6 @@
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.20.0",
"babel-jest": "^27.4.2",
"babel-preset-react-app": "^10.0.1",
"camelcase": "^6.2.1",
"css-mediaquery": "^0.1.2",
"dotenv": "^10.0.0",
Expand All @@ -135,6 +137,7 @@
"react-test-renderer": "^18.2.0",
"redux-mock-store": "^1.5.4",
"source-map-explorer": "^2.5.3",
"ts-jest": "^27.1.5",
"typescript": "^4.9.5"
},
"jest": {
Expand All @@ -155,10 +158,11 @@
"<rootDir>/src/**/*.test.{js,jsx,ts,tsx}"
],
"testEnvironment": "jsdom",
"preset": "ts-jest",
"transform": {
"^.+\\.(js|jsx|mjs|cjs|ts|tsx)$": "<rootDir>/config/jest/babelTransform.js",
"^.+\\.jsx?$": "babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
"^(?!.*\\.(cjs|js|jsx|mjs|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
"transformIgnorePatterns": [
"/node_modules/(!${axios})"
Expand Down Expand Up @@ -215,10 +219,5 @@
},
"volta": {
"node": "18.15.0"
},
"babel": {
"presets": [
"react-app"
]
}
}
File renamed without changes.
9 changes: 8 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,12 @@
"target": "es5"
},
"exclude": ["*.dic.js"],
"include": [".eslintrc.cjs", "config", "public", "src", "scripts"]
"include": [
".eslintrc.cjs",
"config",
"public",
"src",
"scripts",
"*.config.js"
]
}

0 comments on commit 2122ffa

Please sign in to comment.