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
…7724)

Signed-off-by: LongYinan <longyinan.brooklyn@bytedance.com>
  • Loading branch information
Brooooooklyn committed Sep 14, 2020
1 parent 5af64a3 commit de3ae77
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
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, dynamicImport: true }],
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/fileTransformer.js',
},
Expand Down
3 changes: 2 additions & 1 deletion 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.4",
"@testing-library/jest-dom": "^5.8.0",
"@testing-library/react": "^11.0.2",
"@testing-library/react-hooks": "^3.2.1",
Expand Down Expand Up @@ -117,4 +118,4 @@
"git add"
]
}
}
}
45 changes: 45 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2439,6 +2439,13 @@
call-me-maybe "^1.0.1"
glob-to-regexp "^0.3.0"

"@node-rs/helper@^0.4.0":
version "0.4.0"
resolved "https://registry.npmjs.org/@node-rs/helper/-/helper-0.4.0.tgz#deec7d95aafa90535980a51cbd5336b8bbefe93a"
integrity sha512-fSyHEXmlt/FueKqAYiGFCnkohnQBMQwUr6VYPeZEeVBAzQzhioS1WaRe2fSpOuRKIimCQEvxhQ6fwsYxYakfGA==
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 @@ -2916,6 +2923,39 @@
semver-diff "^2.0.0"
xdg-basedir "^3.0.0"

"@swc-node/core-darwin@^0.7.2":
version "0.7.2"
resolved "https://registry.npmjs.org/@swc-node/core-darwin/-/core-darwin-0.7.2.tgz#7475605b8f7fd02dae8973c85ac25bc27caf1c0a"
integrity sha512-WyeviZGhP/glgEsH1QHjrwmLyaXTUl8Tzn+LiDdglKLwkVd2fWhhLA0PADHfwEaQmXnxEX+PlEl2Ybysn6ibSg==

"@swc-node/core-linux@^0.7.2":
version "0.7.2"
resolved "https://registry.npmjs.org/@swc-node/core-linux/-/core-linux-0.7.2.tgz#ac05546b4154269c4884595798dce78fdd839185"
integrity sha512-LbOO+D7iZSeEz7jcWOTH/7wHcvnqjhaF5Ma/3Mt68ZxFHZFFYhaq6gwsPVQ5YgI3o3lS+FrKsSP3oWjhWhCceA==

"@swc-node/core-win32@^0.7.2":
version "0.7.2"
resolved "https://registry.npmjs.org/@swc-node/core-win32/-/core-win32-0.7.2.tgz#4a3b1f6332888075edf2f43b75b4ad610ce18306"
integrity sha512-4ZSMJ5ndFw339wgFvTT/tUYaNiLBrjFxf2hXKAZ4mR1BQ8BCwHPP8wZLZTErA3MSk9Ezg+uekEfY+QEd+FPaDQ==

"@swc-node/core@^0.7.2":
version "0.7.2"
resolved "https://registry.npmjs.org/@swc-node/core/-/core-0.7.2.tgz#e7054cfa8c6181558d31b75a9738e6db6575d17e"
integrity sha512-g9kZl0kRmTTHHbH3K09nXjx6CaowOzcNfNKdEjLbxKUewNv196EAyJxZwXisOdB5Gx+y1g7sqcBKNG/OPu1hlw==
dependencies:
"@node-rs/helper" "^0.4.0"
optionalDependencies:
"@swc-node/core-darwin" "^0.7.2"
"@swc-node/core-linux" "^0.7.2"
"@swc-node/core-win32" "^0.7.2"

"@swc-node/jest@^0.3.4":
version "0.3.4"
resolved "https://registry.npmjs.org/@swc-node/jest/-/jest-0.3.4.tgz#d125a0794853e0f07e8c96f49a246716dc94f3fa"
integrity sha512-PUiAVzpiPfQ9f80MdaOF0dFn0VDysunV9QARLlYPEeBNFSyj/rkQe17NrmaxcTLkyEr7QcSHL+17gb8NvdPchw==
dependencies:
"@swc-node/core" "^0.7.2"

"@testing-library/dom@^7.23.0":
version "7.24.1"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.24.1.tgz#0e8acd042070f2c1b183fbfe5c0d38b3194ad3c0"
Expand Down Expand Up @@ -18392,6 +18432,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 de3ae77

Please sign in to comment.