Skip to content

Commit

Permalink
Replace babel-jest with @swc-node/jest to speedup frontend testing
Browse files Browse the repository at this point in the history
  • Loading branch information
LongYinan committed Sep 4, 2020
1 parent 5364191 commit 949e7c2
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jest.config.front.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = {
],
testRegex: 'tests/.*\\.test\\.js$',
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.js$': ['@swc-node/jest', { jsx: true }],
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/fileTransformer.js',
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"dependencies": {},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.9.0",
"@swc-node/jest": "0.3.1",
"@testing-library/jest-dom": "^5.8.0",
"@testing-library/react": "^10.4.8",
"@testing-library/react-hooks": "^3.2.1",
Expand Down
45 changes: 45 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2407,6 +2407,13 @@
call-me-maybe "^1.0.1"
glob-to-regexp "^0.3.0"

"@node-rs/helper@^0.3.1":
version "0.3.1"
resolved "https://registry.npmjs.org/@node-rs/helper/-/helper-0.3.1.tgz#605d3fafb344a4b7b664236c9219ac3e1d72361b"
integrity sha512-3X6SJOcyFRYv1mjrjtSHiziJuzAsqaz2pFD3uuLxu4qJo4TH6H0gaUb1Bdxl/VtiDy2yR+eMyBOQFCvr/G2oLA==
dependencies:
tslib "^2.0.1"

"@nodelib/fs.scandir@2.1.3":
version "2.1.3"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b"
Expand Down Expand Up @@ -2884,6 +2891,39 @@
semver-diff "^2.0.0"
xdg-basedir "^3.0.0"

"@swc-node/core-darwin@^0.6.1":
version "0.6.1"
resolved "https://registry.npmjs.org/@swc-node/core-darwin/-/core-darwin-0.6.1.tgz#ad20762202eb25523bb6bdde81e6f6cb5e909bd9"
integrity sha512-tMWzyFhq4zPKnqq7yhUknFQWIishokFMMaqaptXq8w3wnidOhUCr83GhVggnj8r8LnUtNB8pegEj17Kl/20qjQ==

"@swc-node/core-linux@^0.6.1":
version "0.6.1"
resolved "https://registry.npmjs.org/@swc-node/core-linux/-/core-linux-0.6.1.tgz#b17ad7a8dcc1e2c17951e871cfa5c535f1e74145"
integrity sha512-oeE50kwZ8FgmP+MDFWi5aQpi4A+xUsqBQphTI4Cth7IdNqWbCq+sKU1dMn5FBFpyrp9KxXX9zrWOZYN6dtlwcg==

"@swc-node/core-win32@^0.6.1":
version "0.6.1"
resolved "https://registry.npmjs.org/@swc-node/core-win32/-/core-win32-0.6.1.tgz#7c2c09a1d713166a7d86bc4ac74fdfdcd0901314"
integrity sha512-6t8wbrbrY28nLP0rPY6nAuz6wUAZRVwkuEVt6QDrz44eo8wJkPqmZBHhYubDgdiofnxHNOveR9i9sdH2Z7xOSg==

"@swc-node/core@^0.6.1":
version "0.6.1"
resolved "https://registry.npmjs.org/@swc-node/core/-/core-0.6.1.tgz#f3cf3b669f094f6b3d6f78ade54224aaa62a3362"
integrity sha512-5DXGG7u1lawiZuqv2MDgKgXNpjXu08uxg89bPU8PJATGeP+EQtJDgHwM7uF1hmRM1wsOsIy4o1t10w6NUWKCxQ==
dependencies:
"@node-rs/helper" "^0.3.1"
optionalDependencies:
"@swc-node/core-darwin" "^0.6.1"
"@swc-node/core-linux" "^0.6.1"
"@swc-node/core-win32" "^0.6.1"

"@swc-node/jest@0.3.1":
version "0.3.1"
resolved "https://registry.npmjs.org/@swc-node/jest/-/jest-0.3.1.tgz#3a325d3cf603aedc01d091da9a69b00df2d3eef1"
integrity sha512-ClPbHG/v2meKYexKNQuIskHOFjmsjlXC7uU+taMMD+rILREuYvcTEqiauCRAXhEZm/BezJEM2FX+erEIf3Dh/A==
dependencies:
"@swc-node/core" "^0.6.1"

"@testing-library/dom@^7.17.1":
version "7.22.1"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.22.1.tgz#b66861fb7751287bda63a55f5c72ca808c63043c"
Expand Down Expand Up @@ -18330,6 +18370,11 @@ tslib@^1, tslib@^1.10.0, tslib@^1.9.0, tslib@^1.9.3:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35"
integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==

tslib@^2.0.1:
version "2.0.1"
resolved "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e"
integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==

tsscmp@1.0.6, tsscmp@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb"
Expand Down

0 comments on commit 949e7c2

Please sign in to comment.