We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
0 parents commit 7fbd6d5Copy full SHA for 7fbd6d5
README.md
@@ -0,0 +1,37 @@
1
+# 6to5-jest
2
+
3
+**package.json**
4
5
+```json
6
+{
7
+ "dependencies": {
8
+ "6to5": "*",
9
+ "jest": "*"
10
+ },
11
+ "scripts": {
12
+ "test": "jest"
13
14
+ "jest": {
15
+ "scriptPreprocessor": "<rootDir>/preprocessor.js",
16
+ "testFileExtensions": ["es6", "js"],
17
+ "moduleFileExtensions": ["js", "json", "es6"]
18
+ }
19
+}
20
+```
21
22
+**preprocessor.js**
23
24
+```javascript
25
+var to5 = require("6to5");
26
27
+module.exports = {
28
+ process: function (src, filename) {
29
+ // Ignore all files within node_modules
30
+ // 6to5 files can be .js and .es6
31
+ if (filename.indexOf("node_modules") === -1 && to5.canCompile(filename)) {
32
+ return to5.transform(src, { filename: filename }).code;
33
34
+ return src;
35
36
+};
37
0 commit comments