From 44412ad26a445b1bdf29e3296edabc2b474cdee1 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Thu, 4 Jun 2015 19:15:22 -0700 Subject: [PATCH] Use babel-jest to preprocess test files --- jest-unit.json | 12 ++++++------ package.json | 7 ++++--- util/preprocessor.js | 14 -------------- 3 files changed, 10 insertions(+), 23 deletions(-) delete mode 100644 util/preprocessor.js diff --git a/jest-unit.json b/jest-unit.json index 0981c13e..bc91f0f6 100644 --- a/jest-unit.json +++ b/jest-unit.json @@ -1,5 +1,5 @@ { - "scriptPreprocessor": "/util/preprocessor.js", + "scriptPreprocessor": "/node_modules/babel-jest", "setupEnvScriptFile": "/util/testenv.js", "setupTestFrameworkScriptFile": "/util/prepare.js", "unmockedModulePathPatterns": [ @@ -9,10 +9,10 @@ "net", "crypto", "babel", - "/node_modules/.*JSONStream", - "/node_modules/object-assign", - "/node_modules/underscore", - "/node_modules/bluebird", - "/node_modules/source-map-support" + "bluebird", + "object-assign", + "underscore", + "source-map-support", + "/node_modules/.*JSONStream" ] } diff --git a/package.json b/package.json index 1d8db74a..f33814e1 100644 --- a/package.json +++ b/package.json @@ -26,9 +26,9 @@ } ], "docker-version": "1.6.2", - "docker-machine-version": "0.2.0", + "docker-machine-version": "0.3.0-rc1", "docker-compose-version": "1.2.0", - "electron-version": "0.26.0", + "electron-version": "0.27.2", "virtualbox-version": "4.3.28", "virtualbox-filename": "VirtualBox-4.3.28.pkg", "virtualbox-filename-win": "VirtualBox-4.3.28.exe", @@ -57,7 +57,7 @@ "react": "^0.13.1", "react-bootstrap": "^0.20.3", "react-retina-image": "^1.1.2", - "react-router": "^0.13.2", + "react-router": "^0.13.3", "request": "^2.55.0", "request-progress": "^0.3.1", "rimraf": "^2.3.2", @@ -66,6 +66,7 @@ }, "devDependencies": { "babel": "^5.1.10", + "babel-jest": "^5.2.0", "gulp": "^3.8.11", "gulp-babel": "^5.1.0", "gulp-changed": "^1.2.1", diff --git a/util/preprocessor.js b/util/preprocessor.js deleted file mode 100644 index a284c1ea..00000000 --- a/util/preprocessor.js +++ /dev/null @@ -1,14 +0,0 @@ -var babel = require('babel'); -var fs = require('fs'); -var crypto = require('crypto'); - -module.exports = { - process: function(src, filename) { - if (filename.indexOf('node_modules') !== -1) { - return src; - } - var compiled = babel.transform(src, {filename: filename, sourceMap: true}); - fs.writeFileSync('/tmp/' + crypto.createHash('md5').update(filename).digest('hex') + '.map', JSON.stringify(compiled.map)); - return compiled.code; - } -};