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
-lib/
1
+lib/
2
+babel.config.js

+ 10
- 12
babel.config.js View File

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
   // timers: "real",
164
   // timers: "real",
165
 
165
 
166
   // A map from regular expressions to paths to transformers
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
   // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
168
   // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
175
   // transformIgnorePatterns: [
169
   // transformIgnorePatterns: [

+ 0
- 1
package.json View File

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