Skip to content

Commit 0fc171d

Browse files
committed
test: use @swc/jest
1 parent 0c4e7ad commit 0fc171d

File tree

3 files changed

+29
-109
lines changed

3 files changed

+29
-109
lines changed

jest.config.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,7 @@ module.exports = {
99
'^swr/immutable$': '<rootDir>/immutable/index.ts'
1010
},
1111
transform: {
12-
'^.+\\.(t|j)sx?$': [
13-
'@swc-node/jest',
14-
{
15-
jsc: {
16-
minify: false
17-
}
18-
}
19-
]
12+
'^.+\\.(t|j)sx?$': '@swc/jest'
2013
},
2114
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/test/'],
2215
coverageReporters: ['text', 'html']

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@
7171
"tslib": "2.3.0"
7272
},
7373
"devDependencies": {
74-
"@swc-node/jest": "1.4.3",
74+
"@swc/core": "1.2.129",
75+
"@swc/jest": "0.2.17",
7576
"@testing-library/jest-dom": "5.14.1",
7677
"@testing-library/react": "12.0.0",
7778
"@type-challenges/utils": "0.1.1",

yarn.lock

Lines changed: 26 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,13 @@
11051105
slash "^3.0.0"
11061106
strip-ansi "^6.0.0"
11071107

1108+
"@jest/create-cache-key-function@^27.4.2":
1109+
version "27.4.2"
1110+
resolved "https://registry.yarnpkg.com/@jest/create-cache-key-function/-/create-cache-key-function-27.4.2.tgz#09b585f9dbafec0f56cfb0e4d4edfe2bec0e0768"
1111+
integrity sha512-aSSCAJwUNX4R1hJQoyimsND5l+2EsFgzlepS8NuOJJHjXij/UdxYFngac44tmv9IYdI+kglAyORg0plt4/aFMQ==
1112+
dependencies:
1113+
"@jest/types" "^27.4.2"
1114+
11081115
"@jest/environment@^27.2.0":
11091116
version "27.2.0"
11101117
resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.0.tgz#48d1dbfa65f8e4a5a5c6cbeb9c59d1a5c2776f6b"
@@ -1238,6 +1245,17 @@
12381245
"@types/yargs" "^16.0.0"
12391246
chalk "^4.0.0"
12401247

1248+
"@jest/types@^27.4.2":
1249+
version "27.4.2"
1250+
resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.4.2.tgz#96536ebd34da6392c2b7c7737d693885b5dd44a5"
1251+
integrity sha512-j35yw0PMTPpZsUoOBiuHzr1zTYoad1cVIE0ajEjcrJONxxrko/IRGKkXx3os0Nsi4Hu3+5VmDbVfq5WhG/pWAg==
1252+
dependencies:
1253+
"@types/istanbul-lib-coverage" "^2.0.0"
1254+
"@types/istanbul-reports" "^3.0.0"
1255+
"@types/node" "*"
1256+
"@types/yargs" "^16.0.0"
1257+
chalk "^4.0.0"
1258+
12411259
"@napi-rs/triples@^1.0.3":
12421260
version "1.0.3"
12431261
resolved "https://registry.yarnpkg.com/@napi-rs/triples/-/triples-1.0.3.tgz#76d6d0c3f4d16013c61e45dfca5ff1e6c31ae53c"
@@ -1315,90 +1333,6 @@
13151333
dependencies:
13161334
"@napi-rs/triples" "^1.0.3"
13171335

1318-
"@node-rs/[email protected]":
1319-
version "1.1.3"
1320-
resolved "https://registry.yarnpkg.com/@node-rs/xxhash-android-arm-eabi/-/xxhash-android-arm-eabi-1.1.3.tgz#fcd5fa66b26414f3d6f1fd860a960ef99aaff67e"
1321-
integrity sha512-TIMMw7H42klLQ0Fl47ePQZPRrBuZ+w4wG2O1RCXURyLaTe2xH6P+Upu+cdZ6Zi8205HrEUrjlKF2wGgq3gfdig==
1322-
1323-
"@node-rs/[email protected]":
1324-
version "1.1.3"
1325-
resolved "https://registry.yarnpkg.com/@node-rs/xxhash-android-arm64/-/xxhash-android-arm64-1.1.3.tgz#36ca562eaf4184ebb5d604f4228924e0f2241850"
1326-
integrity sha512-ljNQPbMVNcJiVJM0I1teVpwoJduMSTr0zHSp8jq86WZuKCjzTdyZdoKVC3uyTK4TqwkeglrlWbgHCg9Focg1tA==
1327-
1328-
"@node-rs/[email protected]":
1329-
version "1.1.3"
1330-
resolved "https://registry.yarnpkg.com/@node-rs/xxhash-darwin-arm64/-/xxhash-darwin-arm64-1.1.3.tgz#e04c6c466fdb617de26ad614e4d73da1e768e55f"
1331-
integrity sha512-Ib6eUnDi/L12zui3Ou3ldnuyeDztbVegHX5ClKJZjMKJNuEXOhPGcIoZ+vKn+o0mTnh9y+RFFsnjxfKGaH/FEg==
1332-
1333-
"@node-rs/[email protected]":
1334-
version "1.1.3"
1335-
resolved "https://registry.yarnpkg.com/@node-rs/xxhash-darwin-x64/-/xxhash-darwin-x64-1.1.3.tgz#a90fb8af4f4b8d5280da164af5fe16c6078301a2"
1336-
integrity sha512-7xEnNl68HaHKKvjLnIK2cCjk+HQZzw6Ziuh6Okolal7XhtKMmUiz5wo5RRKhg/et5qGLD03WgHTZjNG2MekB4w==
1337-
1338-
"@node-rs/[email protected]":
1339-
version "1.1.3"
1340-
resolved "https://registry.yarnpkg.com/@node-rs/xxhash-freebsd-x64/-/xxhash-freebsd-x64-1.1.3.tgz#4282cd040cfcf5efb2189236d35286b1e2d40c4b"
1341-
integrity sha512-wRaivI1pmOI5JgWxyau0oVQUK/vTAKGEt+genVcnDvuG5V2cAmiRgJXYLNVDBBo9DiDAH9vQDs8SJLBcNCps8Q==
1342-
1343-
"@node-rs/[email protected]":
1344-
version "1.1.3"
1345-
resolved "https://registry.yarnpkg.com/@node-rs/xxhash-linux-arm-gnueabihf/-/xxhash-linux-arm-gnueabihf-1.1.3.tgz#1925cb107916d77d860d33c8a2c69499907afea8"
1346-
integrity sha512-1UlERcrph4lAKhoCoS5QHZPUau2J/pMPoD87Ip84IUD8LjXgq/yiSeq1LYVsUk22Qx9G4S50YHQopfYNv+iIZQ==
1347-
1348-
"@node-rs/[email protected]":
1349-
version "1.1.3"
1350-
resolved "https://registry.yarnpkg.com/@node-rs/xxhash-linux-arm64-gnu/-/xxhash-linux-arm64-gnu-1.1.3.tgz#3a0024d30d1a92b37b2d5d7faea07f5644c1e7b4"
1351-
integrity sha512-sTtu2wGfB/hD/2qw/1wLn8XtqygXnkWciK32M6qZwZYsw7vWzGYWqkibQ+nR0bb+AGhbdbMldSkrxICAwgpRiQ==
1352-
1353-
"@node-rs/[email protected]":
1354-
version "1.1.3"
1355-
resolved "https://registry.yarnpkg.com/@node-rs/xxhash-linux-arm64-musl/-/xxhash-linux-arm64-musl-1.1.3.tgz#bb41457b1168f6d9ef565c822245c1f21756ea44"
1356-
integrity sha512-tXRt8Vo4daY09yKfPgV3t+d8o+J4N55hLW6YJRgUvCkPvIwmb3lOA5tz/IqJ3JnqMVL31ExpWuR28DPQXxhpNQ==
1357-
1358-
"@node-rs/[email protected]":
1359-
version "1.1.3"
1360-
resolved "https://registry.yarnpkg.com/@node-rs/xxhash-linux-x64-gnu/-/xxhash-linux-x64-gnu-1.1.3.tgz#8712471d3e9c9dcbd5e89c0832cd8c6e16b2e7f6"
1361-
integrity sha512-UsdSPCX0kzdfHrW1HIhUPK9DtM89/GaV4ZxezIBPqgp22cXv3FebVOurf8SpeKnqPwWbaabOLw2eiybg+p/hww==
1362-
1363-
"@node-rs/[email protected]":
1364-
version "1.1.3"
1365-
resolved "https://registry.yarnpkg.com/@node-rs/xxhash-linux-x64-musl/-/xxhash-linux-x64-musl-1.1.3.tgz#dce7f9c1d9519f97fc183cc80ca6d47aa16bdd85"
1366-
integrity sha512-kVMj1NIhGfXXw8z5/O/Y4Qz4EQDqcsjMdbc5oBvIDoPFiLHuOg4I9E+Z+4NMApWc3ZrSkmbR74FvYbCwqCGERg==
1367-
1368-
"@node-rs/[email protected]":
1369-
version "1.1.3"
1370-
resolved "https://registry.yarnpkg.com/@node-rs/xxhash-win32-arm64-msvc/-/xxhash-win32-arm64-msvc-1.1.3.tgz#8ab96c64c5dcf5cca999e28973fe25ca53c1eaeb"
1371-
integrity sha512-1jwbZRmtA3YXQT9h3m5jHLRkAWvCvCHU93jFYD12w1JIf+HDk6/KhiJnhWPM2G2kj7T6PmRlELqJIy8FdE5B8Q==
1372-
1373-
"@node-rs/[email protected]":
1374-
version "1.1.3"
1375-
resolved "https://registry.yarnpkg.com/@node-rs/xxhash-win32-ia32-msvc/-/xxhash-win32-ia32-msvc-1.1.3.tgz#e20d100f24ed76b6d027aeaaa276ce7aedb915a1"
1376-
integrity sha512-7Fs2zH+fjIGzBXs4QR3+kfthunmvgcoFcHv7kIhZwuiiDJ+crurIgDqCreWrbzQapoESIz9xiuae8p/fNuacuA==
1377-
1378-
"@node-rs/[email protected]":
1379-
version "1.1.3"
1380-
resolved "https://registry.yarnpkg.com/@node-rs/xxhash-win32-x64-msvc/-/xxhash-win32-x64-msvc-1.1.3.tgz#57952839e79be0d7c5acd13cf4b219f7999efdb6"
1381-
integrity sha512-eOsGfWVioCFkzOQHrxmU/qFoZPHjdHwyRKxp7wl7QHFe9LcIBs/wF1iU+8TqTf0DC9V7BEiSnJ2NhZWRnDAXnQ==
1382-
1383-
"@node-rs/xxhash@^1.0.1":
1384-
version "1.1.3"
1385-
resolved "https://registry.yarnpkg.com/@node-rs/xxhash/-/xxhash-1.1.3.tgz#ccffaab35e339ac67a0adc01fc0686ad5cdddc9c"
1386-
integrity sha512-yfLsMIpVwvG/BGrEOXj3he2JHFDeddzH0nj8W1teGNt9wytAIBd4Z81oV0EYfSUuNV5LJh9YZX0VCn7NXBzSsw==
1387-
optionalDependencies:
1388-
"@node-rs/xxhash-android-arm-eabi" "1.1.3"
1389-
"@node-rs/xxhash-android-arm64" "1.1.3"
1390-
"@node-rs/xxhash-darwin-arm64" "1.1.3"
1391-
"@node-rs/xxhash-darwin-x64" "1.1.3"
1392-
"@node-rs/xxhash-freebsd-x64" "1.1.3"
1393-
"@node-rs/xxhash-linux-arm-gnueabihf" "1.1.3"
1394-
"@node-rs/xxhash-linux-arm64-gnu" "1.1.3"
1395-
"@node-rs/xxhash-linux-arm64-musl" "1.1.3"
1396-
"@node-rs/xxhash-linux-x64-gnu" "1.1.3"
1397-
"@node-rs/xxhash-linux-x64-musl" "1.1.3"
1398-
"@node-rs/xxhash-win32-arm64-msvc" "1.1.3"
1399-
"@node-rs/xxhash-win32-ia32-msvc" "1.1.3"
1400-
"@node-rs/xxhash-win32-x64-msvc" "1.1.3"
1401-
14021336
"@nodelib/[email protected]":
14031337
version "2.1.5"
14041338
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
@@ -1498,21 +1432,6 @@
14981432
dependencies:
14991433
"@sinonjs/commons" "^1.7.0"
15001434

1501-
"@swc-node/core@^1.8.2":
1502-
version "1.8.2"
1503-
resolved "https://registry.yarnpkg.com/@swc-node/core/-/core-1.8.2.tgz#950ad394a8e8385658e6a951ec554bbf61a1693e"
1504-
integrity sha512-IoJ7tGHQ6JOMSmFe4VhP64uLmFKMNasS0QEgUrLFQ0h/dTvpQMynnoGBEJoPL6LfsebZ/q4uKqbpWrth6/yrAA==
1505-
dependencies:
1506-
"@swc/core" "^1.2.119"
1507-
1508-
"@swc-node/[email protected]":
1509-
version "1.4.3"
1510-
resolved "https://registry.yarnpkg.com/@swc-node/jest/-/jest-1.4.3.tgz#e43d01ce8bc392ccabf8c969fc5335cf5e4d6664"
1511-
integrity sha512-pMWida9hKd/c6fUor+Sd+Oikxl7X23o9U/MmXsaPEt2gWx5Ar9JjGo0h0Vd30h5Cua2F0FD4/42qeAmMj0qskw==
1512-
dependencies:
1513-
"@node-rs/xxhash" "^1.0.1"
1514-
"@swc-node/core" "^1.8.2"
1515-
15161435
15171436
version "1.2.129"
15181437
resolved "https://registry.yarnpkg.com/@swc/core-android-arm-eabi/-/core-android-arm-eabi-1.2.129.tgz#4fb265ecaaba17e879be179213b8a81ae7730c72"
@@ -1578,7 +1497,7 @@
15781497
resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.129.tgz#122f747a5f80777aa2f94d835067fb3602a7cedb"
15791498
integrity sha512-SqfiGn1KTlunTK42gtJ7XUP0IaVkYKQAfBEP6PT+t5xoQVcxOla5lR8cvoN5b2wQkFUL/yLkc+HuFjzi5vdppg==
15801499

1581-
"@swc/core@^1.2.119":
1500+
"@swc/[email protected].129":
15821501
version "1.2.129"
15831502
resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.2.129.tgz#58f1b9f402d2c82fc6d0393cb2011621838c5f1c"
15841503
integrity sha512-Ay2Vt/uI+vRn6Nu5nRTjcuRlXejN5VfYOCCsNGqA5DIrhO0VSwxyOncL/kYlGtzE5XhYBE5eU8QIkRC+koI/fw==
@@ -1599,6 +1518,13 @@
15991518
"@swc/core-win32-ia32-msvc" "1.2.129"
16001519
"@swc/core-win32-x64-msvc" "1.2.129"
16011520

1521+
1522+
version "0.2.17"
1523+
resolved "https://registry.yarnpkg.com/@swc/jest/-/jest-0.2.17.tgz#0a36083cf5bca39c3c03323cdfc84b61fd670ac2"
1524+
integrity sha512-n/g989+O8xxMcTZnP0phDrrgezGZBQBf7cX4QuzEsn07QkWbqmMsfaCxdF0kzajXublXWJ8yk5vRe3VNk1tczA==
1525+
dependencies:
1526+
"@jest/create-cache-key-function" "^27.4.2"
1527+
16021528
"@testing-library/dom@^7.28.1":
16031529
version "7.31.2"
16041530
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.31.2.tgz#df361db38f5212b88555068ab8119f5d841a8c4a"

0 commit comments

Comments
 (0)