Open OneCyrus opened 7 years ago
I'm getting a similar error:
FAIL build/default/src/responsive-editor/js/store/__tests__/Responsivetemplate.mjs
● Test suite failed to run
/Users/daniel/Workspace/work/AgreementExpress/TemplateBuilder/src/main/webapp/.cache/jest-webpack/build/default/src/responsive-editor/js/store/__tests__/Responsivetemplate.mjs: Unexpected token (81:85)
79 |
80 | module.exports = {
> 81 | "8fbf8d85b48eb51e8ccaff72ecb60611ce5f48ec": function() {return __webpack_require__(./build/default/src/responsive-editor/js/store/__tests__/Responsivetemplate.mjs);}
| ^
82 | };
83 | module.exports["8fbf8d85b48eb51e8ccaff72ecb60611ce5f48ec"]();
84 |
Config:
"jest": {
"moduleFileExtensions": [
"js",
"json",
"jsx",
"node",
"mjs"
],
"testMatch": [
"**/__tests__/**/*.js?(x)",
"**/__tests__/**/*.mjs"
],
"testPathIgnorePatterns": [
"/node_modules/",
"/__tests__/_\\w+/"
],
"transform": {
"^.+\\.jsx?$": "babel-jest",
"^.+\\.mjs$": "babel-jest"
}
},
devtool: isDevelopment ? 'cheap-module-eval-source-map' : false,
entry: {
app: './src/app/main.mjs',
},
resolve: {
extensions: ['.js', '.mjs', '.jsx', '.mjsx', '.json'],
},
module: {
loaders: [
{
test: /\.m?jsx?$/,
exclude: s => /node_modules/.test(s) && !/react-polymer/.test(s),
loader: 'babel-loader',
}
],
},
output: {
path: path.join(__dirname, 'bundles'),
filename: '[name].js',
},
my project with typescript has some issues with paths. don't know what's happening there?!
the corresponding code in widget.test.tsx (webpacked). shouldn't the argument be a string?