Hi,
I am trying to run tests with AVA and your plugin.
At the first place, it wasn't working (error below). I rm -rf node_modules, then tried again and it was working (tests on jsx and react were failing as expected). No idea why, I changed a string in my file, and got this error:
Uncaught Exception: /Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/web_modules/Button/__tests__/index.js
SyntaxError: /Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/web_modules/Button/__tests__/index.js: Unexpected token import
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at localInteropRequire (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-plugin-webpack-loaders/lib/plugin.js:211:13)
at PluginPass.CallExpression (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-plugin-webpack-loaders/lib/plugin.js:41:135)
at newFn (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-traverse/lib/visitors.js:262:19)
at NodePath._call (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-traverse/lib/path/context.js:63:18)
at NodePath.call (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-traverse/lib/path/context.js:47:17)
at NodePath.visit (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-traverse/lib/path/context.js:93:12)
at TraversalContext.visitQueue (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-traverse/lib/context.js:152:16)
at TraversalContext.visitSingle (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-traverse/lib/context.js:115:19)
at TraversalContext.visit (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-traverse/lib/context.js:184:19)
I reverted my changes but same problem.
Note that I run with the following command (I just pasted interesting part)
{
"scripts": {
"ava": "CONFIG=$(pwd)/webpack.config.test.babel.js BABEL_DISABLE_CACHE=1 NODE_ENV=test ava",
"test": "npm run lint && npm run ava"
},
"babel": {
"presets": [
"babel-preset-react",
"babel-preset-es2015",
"babel-preset-stage-1"
],
"env": {
"production": {
"plugins": [
"babel-plugin-react-remove-prop-types"
]
},
"test": {
"plugins": [
[
"babel-plugin-webpack-loaders",
{
"config": "${CONFIG}",
"verbose": false
}
]
]
}
}
},
"ava": {
"files": [
"web_modules/**/__tests__/*.js"
],
"failFast": true,
"verbose": true,
"require": [
"babel-register"
],
"babel": "inherit"
},
I cannot share my webpack config as it's very messy and private, just be sure that I use this
// import normal config
import webpackConfig from "./webpack.config.babel.js"
export default {
...webpackConfig,
// babel-plugin-webpack-loaders requirements
entry: undefined,
output: {
libraryTarget: "commonjs2",
},
}
Hi,
I am trying to run tests with AVA and your plugin.
At the first place, it wasn't working (error below). I rm -rf node_modules, then tried again and it was working (tests on jsx and react were failing as expected). No idea why, I changed a string in my file, and got this error:
I reverted my changes but same problem.
Note that I run with the following command (I just pasted interesting part)
I cannot share my webpack config as it's very messy and private, just be sure that I use this