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
Signed-off-by: LongYinan <longyinan.brooklyn@bytedance.com>
  • Loading branch information
LongYinan authored and Brooooooklyn committed Sep 4, 2020
1 parent bd29fe7 commit bdc54bc
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.2",
"@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.0":
version "0.7.0"
resolved "https://registry.npmjs.org/@swc-node/core-darwin/-/core-darwin-0.7.0.tgz#e04dbaf93d320a6ef844c0d85bd3ef5db7265882"
integrity sha512-gSMAAs7lfqUezPhVmsFMCyhO43n9X84/EUFp8M4K5x30pEMFlUxXAV88QDVUV4nHOzS9sbVDohu8tYZMQKOwWQ==

"@swc-node/core-linux@^0.7.0":
version "0.7.0"
resolved "https://registry.npmjs.org/@swc-node/core-linux/-/core-linux-0.7.0.tgz#94a31833bd40760d4fe1fc4c2f38cbf6007ccdb0"
integrity sha512-dLVsEs/K2idyXzaLy0b1YQZU6LxtwAjrfd3OQgfkdJKOvs6OATy7rLnDntyIGdHhOkm4W6pwNAiEtONh1yoBFA==

"@swc-node/core-win32@^0.7.0":
version "0.7.0"
resolved "https://registry.npmjs.org/@swc-node/core-win32/-/core-win32-0.7.0.tgz#583d2efbd671a018b36edee86476f72645d54ddd"
integrity sha512-n/MOh6ZFxrGDncL2Wdc8Hk2I/SipnwVFzf/HqCU1+KkCaww3B8vTOnhaN+2h7QVJkFH+Hj7vfW1qwRkFJKbzNA==

"@swc-node/core@^0.7.0":
version "0.7.0"
resolved "https://registry.npmjs.org/@swc-node/core/-/core-0.7.0.tgz#c04f45f5b4b95a5579facf9cddbb3eacf5c83e02"
integrity sha512-UIZwZCyR6H2RXx5uUT5UlHYK+2XNnrT9aFYCtND98ZRufOpq4Z//FJ/LalvYuaM56MGaiZCpjLWmk8yn66cIwA==
dependencies:
"@node-rs/helper" "^0.4.0"
optionalDependencies:
"@swc-node/core-darwin" "^0.7.0"
"@swc-node/core-linux" "^0.7.0"
"@swc-node/core-win32" "^0.7.0"

"@swc-node/jest@0.3.2":
version "0.3.2"
resolved "https://registry.npmjs.org/@swc-node/jest/-/jest-0.3.2.tgz#4d7973ca746563a7ec9288f30684603d4fd24cc4"
integrity sha512-waVQu41Eu7ePqBlRQUEmDNGDBwc95BOeg+KHHIYIlXa6LMecxCkoxDwNYEmEUG7GfPURrbyi+SEkIEZ1a73I6w==
dependencies:
"@swc-node/core" "^0.7.0"

"@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 bdc54bc

Please sign in to comment.