Closed jzena closed 5 years ago
Jest needs your Babel config in your Wallaby cache folder in order to compile node modules, so you need to add your babel config file to your files
list, so something like this should help:
...
module.exports = function(wallaby) {
...
return {
files: [
'src/**/*.+(js|jsx|json|snap|css|less|sass|scss|jpg|jpeg|gif|png|svg)',
+ 'babel.config.js' // or whatever your babel config name is
...
],
...
};
};
Hi @ArtemGovorov thanks for the response, I've added the babel config and now I'm getting this issue:
As you can see the are errors on files that don't have test
extension. Is there any missing on my wallaby configuration?
on the other side how can I use the babel.config.js
file inside of wallaby.compilers.babel
?
[Error] Some long running code has been detected: one of your files is taking more than 5000ms to execute.
[Error] Execution of the following files has started but has not finished:
[Error] - src/store.js
[Error] - src/actions/account.actions.js
[Error] - src/actions/project.actions.js
[Error] - src/core/auth.core.js
[Error] - src/core/index.js
[Error] - src/reducers/account.reducer.js
[Error] - src/reducers/index.js
[Error] - src/components/common/index.js
[Error] - src/components/common/Header/Header.js
[Error] - src/components/common/ProjectSelector/ProjectSelector.js
[Error] - src/components/common/Header/tests/Header.test.js
[Error] Try commenting out the test or excluding the test file from the `tests` list in your wallaby config,
[Error] and restarting wallaby to make sure that it is this test/file causing the issue and not something else.
[Error] Pinging test runner sandbox...
[Error] The sandbox is not responsive. Check for possibly recently introduced infinite loops.
As you can see the are errors on files that don't have test extension. Is there any missing on my wallaby configuration?
It's hard to tell, the error says that one of your tests in src/components/common/Header/tests/Header.test.js
never ends executing. From the stack of files it looks like the execution freezes somewhere in the src/store.js
file. The error message may also pop up if one of you tests takes >5s to execute, so if your test runs succeeds eventually, then you may just ignore the error.
If if hangs forever, then we'll need a sample repo from you to be able to reproduce and investigate the configuration issue.
on the other side how can I use the babel.config.js file inside of wallaby.compilers.babel
It should happen automatically if you just have:
compilers: {
'**/*.js': wallaby.compilers.babel({})
},
Issue description or question
I'm running into an issue where my test fails to run with a message like this: However when I run
npm run test
the test works as expected, could you help with that please."jest": "^22.4.4",
"enzyme": "3.3.0",
"enzyme-adapter-react-16": "^1.5.0",
"enzyme-to-json": "^3.3.4",
"@babel/cli": "^7.1.5",
"@babel/core": "^7.1.6",
"@babel/node": "^7.0.0",
babel.config File
jest.config.json
Wallaby.js configuration file
Code editor or IDE name and version
Visual Studio Code v1.29.1
OS name and version
Windows