Skip to content

Commit db5c65f

Browse files
committed
Make Jest compatible with .ts files
1 parent 9049fce commit db5c65f

File tree

3 files changed

+63
-4
lines changed

3 files changed

+63
-4
lines changed

babel.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
module.exports = {
2-
presets: ['@babel/env', '@babel/react'],
2+
presets: ['@babel/env', '@babel/react', '@babel/preset-typescript'],
33
env: {
44
test: {
5-
plugins: [
6-
'@babel/plugin-transform-runtime',
7-
],
5+
plugins: ['@babel/plugin-transform-runtime'],
86
},
97
},
108
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@babel/plugin-transform-runtime": "^7.7.6",
2323
"@babel/preset-env": "^7.4.5",
2424
"@babel/preset-react": "^7.0.0",
25+
"@babel/preset-typescript": "^7.8.3",
2526
"@babel/runtime": "^7.7.7",
2627
"@testing-library/react": "^9.1.3",
2728
"babel-jest": "^24.9.0",

yarn.lock

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,18 @@
209209
"@babel/helper-replace-supers" "^7.7.4"
210210
"@babel/helper-split-export-declaration" "^7.7.4"
211211

212+
"@babel/helper-create-class-features-plugin@^7.8.3":
213+
version "7.8.3"
214+
resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.8.3.tgz#5b94be88c255f140fd2c10dd151e7f98f4bff397"
215+
integrity sha512-qmp4pD7zeTxsv0JNecSBsEmG1ei2MqwJq4YQcK3ZWm/0t07QstWfvuV/vm3Qt5xNMFETn2SZqpMx2MQzbtq+KA==
216+
dependencies:
217+
"@babel/helper-function-name" "^7.8.3"
218+
"@babel/helper-member-expression-to-functions" "^7.8.3"
219+
"@babel/helper-optimise-call-expression" "^7.8.3"
220+
"@babel/helper-plugin-utils" "^7.8.3"
221+
"@babel/helper-replace-supers" "^7.8.3"
222+
"@babel/helper-split-export-declaration" "^7.8.3"
223+
212224
"@babel/helper-create-regexp-features-plugin@^7.7.4":
213225
version "7.7.4"
214226
resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.4.tgz#6d5762359fd34f4da1500e4cff9955b5299aaf59"
@@ -296,6 +308,13 @@
296308
dependencies:
297309
"@babel/types" "^7.7.4"
298310

311+
"@babel/helper-member-expression-to-functions@^7.8.3":
312+
version "7.8.3"
313+
resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz#659b710498ea6c1d9907e0c73f206eee7dadc24c"
314+
integrity sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==
315+
dependencies:
316+
"@babel/types" "^7.8.3"
317+
299318
"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.7.0", "@babel/helper-module-imports@^7.7.4", "@babel/helper-module-imports@^7.8.3":
300319
version "7.8.3"
301320
resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz#7fe39589b39c016331b6b8c3f441e8f0b1419498"
@@ -329,6 +348,13 @@
329348
dependencies:
330349
"@babel/types" "^7.7.4"
331350

351+
"@babel/helper-optimise-call-expression@^7.8.3":
352+
version "7.8.3"
353+
resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz#7ed071813d09c75298ef4f208956006b6111ecb9"
354+
integrity sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==
355+
dependencies:
356+
"@babel/types" "^7.8.3"
357+
332358
333359
version "7.8.0"
334360
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.0.tgz#59ec882d43c21c544ccb51decaecb306b34a8231"
@@ -367,6 +393,16 @@
367393
"@babel/traverse" "^7.7.4"
368394
"@babel/types" "^7.7.4"
369395

396+
"@babel/helper-replace-supers@^7.8.3":
397+
version "7.8.3"
398+
resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.8.3.tgz#91192d25f6abbcd41da8a989d4492574fb1530bc"
399+
integrity sha512-xOUssL6ho41U81etpLoT2RTdvdus4VfHamCuAm4AHxGr+0it5fnwoVdwUJ7GFEqCsQYzJUhcbsN9wB9apcYKFA==
400+
dependencies:
401+
"@babel/helper-member-expression-to-functions" "^7.8.3"
402+
"@babel/helper-optimise-call-expression" "^7.8.3"
403+
"@babel/traverse" "^7.8.3"
404+
"@babel/types" "^7.8.3"
405+
370406
"@babel/helper-simple-access@^7.7.0", "@babel/helper-simple-access@^7.7.4":
371407
version "7.7.4"
372408
resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.7.4.tgz#a169a0adb1b5f418cfc19f22586b2ebf58a9a294"
@@ -686,6 +722,13 @@
686722
dependencies:
687723
"@babel/helper-plugin-utils" "^7.0.0"
688724

725+
"@babel/plugin-syntax-typescript@^7.8.3":
726+
version "7.8.3"
727+
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.8.3.tgz#c1f659dda97711a569cef75275f7e15dcaa6cabc"
728+
integrity sha512-GO1MQ/SGGGoiEXY0e0bSpHimJvxqB7lktLLIq2pv8xG7WZ8IMEle74jIe1FhprHBWjwjZtXHkycDLZXIWM5Wfg==
729+
dependencies:
730+
"@babel/helper-plugin-utils" "^7.8.3"
731+
689732
"@babel/plugin-transform-arrow-functions@^7.2.0", "@babel/plugin-transform-arrow-functions@^7.7.4":
690733
version "7.7.4"
691734
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.7.4.tgz#76309bd578addd8aee3b379d809c802305a98a12"
@@ -1033,6 +1076,15 @@
10331076
"@babel/helper-plugin-utils" "^7.0.0"
10341077
"@babel/plugin-syntax-typescript" "^7.7.4"
10351078

1079+
"@babel/plugin-transform-typescript@^7.8.3":
1080+
version "7.8.3"
1081+
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.8.3.tgz#be6f01a7ef423be68e65ace1f04fc407e6d88917"
1082+
integrity sha512-Ebj230AxcrKGZPKIp4g4TdQLrqX95TobLUWKd/CwG7X1XHUH1ZpkpFvXuXqWbtGRWb7uuEWNlrl681wsOArAdQ==
1083+
dependencies:
1084+
"@babel/helper-create-class-features-plugin" "^7.8.3"
1085+
"@babel/helper-plugin-utils" "^7.8.3"
1086+
"@babel/plugin-syntax-typescript" "^7.8.3"
1087+
10361088
"@babel/plugin-transform-unicode-regex@^7.4.4", "@babel/plugin-transform-unicode-regex@^7.7.0", "@babel/plugin-transform-unicode-regex@^7.7.4":
10371089
version "7.7.4"
10381090
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.4.tgz#a3c0f65b117c4c81c5b6484f2a5e7b95346b83ae"
@@ -1279,6 +1331,14 @@
12791331
"@babel/helper-plugin-utils" "^7.0.0"
12801332
"@babel/plugin-transform-typescript" "^7.7.2"
12811333

1334+
"@babel/preset-typescript@^7.8.3":
1335+
version "7.8.3"
1336+
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.8.3.tgz#90af8690121beecd9a75d0cc26c6be39d1595d13"
1337+
integrity sha512-qee5LgPGui9zQ0jR1TeU5/fP9L+ovoArklEqY12ek8P/wV5ZeM/VYSQYwICeoT6FfpJTekG9Ilay5PhwsOpMHA==
1338+
dependencies:
1339+
"@babel/helper-plugin-utils" "^7.8.3"
1340+
"@babel/plugin-transform-typescript" "^7.8.3"
1341+
12821342
12831343
version "7.7.2"
12841344
resolved "https://registry.yarnpkg.com/@babel/runtime-corejs2/-/runtime-corejs2-7.7.2.tgz#5a8c4e2f8688ce58adc9eb1d8320b6e7341f96ce"

0 commit comments

Comments
 (0)