diff --git a/lib/babel.js b/lib/babel.js index a6b8890ea..51232f526 100644 --- a/lib/babel.js +++ b/lib/babel.js @@ -3,7 +3,6 @@ var createEspowerPlugin = require('babel-plugin-espower/create'); var requireFromString = require('require-from-string'); var loudRejection = require('loud-rejection/api')(process); var resolveFrom = require('resolve-from'); -var hasGenerator = require('has-generator'); var serializeValue = require('./serialize-value'); var send = require('./send'); @@ -13,7 +12,7 @@ var testPath = process.argv[2]; var babel; try { - var localBabel = resolveFrom('.', 'babel-core') || resolveFrom('.', 'babel'); + var localBabel = resolveFrom('.', 'babel-core'); babel = require(localBabel); } catch (err) { babel = require('babel-core'); @@ -24,11 +23,9 @@ var powerAssert = createEspowerPlugin(babel, { patterns: require('./enhance-assert').PATTERNS }); -// if generators are not supported, use regenerator var options = { - blacklist: hasGenerator ? ['regenerator'] : [], - optional: hasGenerator ? ['asyncToGenerator', 'runtime'] : ['runtime'], - plugins: [powerAssert] + presets: ['stage-3', 'es2015'], + plugins: [powerAssert, 'transform-runtime'] }; // check if test files required ava and show error, when they didn't @@ -40,9 +37,7 @@ process.on('uncaughtException', function (exception) { // include test file var transpiled = babel.transformFileSync(testPath, options); -requireFromString(transpiled.code, testPath, { - appendPaths: module.paths -}); +requireFromString(transpiled.code, testPath); // if ava was not required, show an error if (!exports.avaRequired) { diff --git a/package.json b/package.json index e5851dbda..429b3630c 100644 --- a/package.json +++ b/package.json @@ -73,9 +73,13 @@ "dependencies": { "arr-flatten": "^1.0.1", "ava-init": "^0.1.0", - "babel-core": "^5.8.23", - "babel-plugin-espower": "^1.1.0", - "babel-runtime": "^5.8.29", + "babel-core": "6.0.14", + "babel-plugin-espower": "^2.0.0", + "babel-plugin-transform-runtime": "6.0.14", + "babel-polyfill": "6.0.14", + "babel-preset-es2015": "6.0.14", + "babel-preset-stage-3": "6.0.14", + "babel-runtime": "^5.8.34", "bluebird": "^3.0.0", "chalk": "^1.0.0", "co-with-promise": "^4.6.0",