mirror of https://github.com/docker/docs.git
Use babel-jest to preprocess test files
This commit is contained in:
parent
4d82006b57
commit
44412ad26a
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"scriptPreprocessor": "<rootDir>/util/preprocessor.js",
|
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest",
|
||||||
"setupEnvScriptFile": "<rootDir>/util/testenv.js",
|
"setupEnvScriptFile": "<rootDir>/util/testenv.js",
|
||||||
"setupTestFrameworkScriptFile": "<rootDir>/util/prepare.js",
|
"setupTestFrameworkScriptFile": "<rootDir>/util/prepare.js",
|
||||||
"unmockedModulePathPatterns": [
|
"unmockedModulePathPatterns": [
|
||||||
|
|
@ -9,10 +9,10 @@
|
||||||
"net",
|
"net",
|
||||||
"crypto",
|
"crypto",
|
||||||
"babel",
|
"babel",
|
||||||
"<rootDir>/node_modules/.*JSONStream",
|
"bluebird",
|
||||||
"<rootDir>/node_modules/object-assign",
|
"object-assign",
|
||||||
"<rootDir>/node_modules/underscore",
|
"underscore",
|
||||||
"<rootDir>/node_modules/bluebird",
|
"source-map-support",
|
||||||
"<rootDir>/node_modules/source-map-support"
|
"<rootDir>/node_modules/.*JSONStream"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,9 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"docker-version": "1.6.2",
|
"docker-version": "1.6.2",
|
||||||
"docker-machine-version": "0.2.0",
|
"docker-machine-version": "0.3.0-rc1",
|
||||||
"docker-compose-version": "1.2.0",
|
"docker-compose-version": "1.2.0",
|
||||||
"electron-version": "0.26.0",
|
"electron-version": "0.27.2",
|
||||||
"virtualbox-version": "4.3.28",
|
"virtualbox-version": "4.3.28",
|
||||||
"virtualbox-filename": "VirtualBox-4.3.28.pkg",
|
"virtualbox-filename": "VirtualBox-4.3.28.pkg",
|
||||||
"virtualbox-filename-win": "VirtualBox-4.3.28.exe",
|
"virtualbox-filename-win": "VirtualBox-4.3.28.exe",
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
"react": "^0.13.1",
|
"react": "^0.13.1",
|
||||||
"react-bootstrap": "^0.20.3",
|
"react-bootstrap": "^0.20.3",
|
||||||
"react-retina-image": "^1.1.2",
|
"react-retina-image": "^1.1.2",
|
||||||
"react-router": "^0.13.2",
|
"react-router": "^0.13.3",
|
||||||
"request": "^2.55.0",
|
"request": "^2.55.0",
|
||||||
"request-progress": "^0.3.1",
|
"request-progress": "^0.3.1",
|
||||||
"rimraf": "^2.3.2",
|
"rimraf": "^2.3.2",
|
||||||
|
|
@ -66,6 +66,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel": "^5.1.10",
|
"babel": "^5.1.10",
|
||||||
|
"babel-jest": "^5.2.0",
|
||||||
"gulp": "^3.8.11",
|
"gulp": "^3.8.11",
|
||||||
"gulp-babel": "^5.1.0",
|
"gulp-babel": "^5.1.0",
|
||||||
"gulp-changed": "^1.2.1",
|
"gulp-changed": "^1.2.1",
|
||||||
|
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Loading…
Reference in New Issue