Browse Source

Use babel preset typescript through react-native instead of ts-jest

Thibault Malbranche 5 years ago
parent
commit
d8dcc0e813
4 changed files with 12 additions and 20 deletions
  1. 2
    1
      .eslintignore
  2. 10
    12
      babel.config.js
  3. 0
    6
      jest.config.js
  4. 0
    1
      package.json

+ 2
- 1
.eslintignore View File

@@ -1 +1,2 @@
1
-lib/
1
+lib/
2
+babel.config.js

+ 10
- 12
babel.config.js View File

@@ -1,12 +1,10 @@
1
-module.exports = function (api) {
2
-    api && api.cache(false);
3
-    return {
4
-      env: {
5
-        test: {
6
-          presets: [
7
-            "module:metro-react-native-babel-preset"
8
-          ],
9
-        }
10
-      }
11
-    };
12
-  }
1
+module.exports = function(api) {
2
+  api && api.cache(false);
3
+  return {
4
+    env: {
5
+      test: {
6
+        presets: ['module:metro-react-native-babel-preset'],
7
+      },
8
+    },
9
+  };
10
+};

+ 0
- 6
jest.config.js View File

@@ -164,12 +164,6 @@ module.exports = {
164 164
   // timers: "real",
165 165
 
166 166
   // A map from regular expressions to paths to transformers
167
-  transform: {
168
-    '^.+\\.ts(x)?$': 'ts-jest',
169
-    '^.+\\.js$': 'babel-jest',
170
-    '^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$':
171
-      '<rootDir>/node_modules/react-native/jest/assetFileTransformer.js',
172
-  },
173 167
 
174 168
   // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
175 169
   // transformIgnorePatterns: [

+ 0
- 1
package.json View File

@@ -50,7 +50,6 @@
50 50
     "react": "16.8.3",
51 51
     "react-native": "0.59.1",
52 52
     "semantic-release": "15.10.3",
53
-    "ts-jest": "24.0.0",
54 53
     "typescript": "3.3.3333"
55 54
   },
56 55
   "repository": {