Commit 00e7a297 authored by Arunoda Susiripala's avatar Arunoda Susiripala Committed by GitHub

Move the test babel setup to the main babelrc file. (#1163)

* Move the test babel setup to the main babelrc file.

* Add es2015 preset.
parent 09442173
...@@ -6,8 +6,17 @@ ...@@ -6,8 +6,17 @@
"transform-runtime" "transform-runtime"
], ],
"env": { "env": {
"test": { "test-build": {
"plugins": ["istanbul"] "plugins": ["istanbul"]
},
"test": {
"presets": [
// To transpile import statements into commonjs.
// That's because Jest(runs in Node.js) don't know how to handle them.
"es2015",
// To let test apps(and Jest) to use Next's babel preset
"./babel"
]
} }
} }
} }
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
"pretestonly": "fly pretest", "pretestonly": "fly pretest",
"testonly": "cross-env NODE_PATH=test/lib jest \\.test.js", "testonly": "cross-env NODE_PATH=test/lib jest \\.test.js",
"posttestonly": "fly posttest", "posttestonly": "fly posttest",
"pretest": "npm run lint && cross-env NODE_ENV=test npm run release", "pretest": "npm run lint && cross-env NODE_ENV=test-build npm run release",
"test": "npm run testonly -- --coverage --forceExit", "test": "npm run testonly -- --coverage --forceExit",
"coveralls": "nyc --instrument=false --source-map=false report --temp-directory=./coverage --reporter=text-lcov | coveralls", "coveralls": "nyc --instrument=false --source-map=false report --temp-directory=./coverage --reporter=text-lcov | coveralls",
"lint": "standard 'bin/*' 'client/**/*.js' 'examples/**/*.js' 'lib/**/*.js' 'pages/**/*.js' 'server/**/*.js' 'test/**/*.js'", "lint": "standard 'bin/*' 'client/**/*.js' 'examples/**/*.js' 'lib/**/*.js' 'pages/**/*.js' 'server/**/*.js' 'test/**/*.js'",
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
"babel-jest": "^18.0.0", "babel-jest": "^18.0.0",
"babel-plugin-istanbul": "^3.0.0", "babel-plugin-istanbul": "^3.0.0",
"babel-plugin-transform-remove-strict-mode": "0.0.2", "babel-plugin-transform-remove-strict-mode": "0.0.2",
"babel-preset-env": "1.1.8", "babel-preset-es2015": "6.22.0",
"benchmark": "2.1.3", "benchmark": "2.1.3",
"cheerio": "^0.22.0", "cheerio": "^0.22.0",
"chromedriver": "^2.26.1", "chromedriver": "^2.26.1",
......
{
"presets": [
// To let test apps(and Jest) to use Next's babel preset
"../babel",
// To transpile import statements into commonjs.
// That's because Jest(runs in Node.js) don't know how to handle them.
"es2015"
]
}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment