Closed lucastraba closed 4 years ago
Your wallaby config file includes node_modules
, so Wallaby babel compiler tries to compile it. Do your have your source files under some subfolder in your project's root, like under src
? If so, try specifying it in your config:
...
files: [
'src/**/*.js?(x)',
'src/**/*.vue?(x)',
'src/**/*.scss?(x)',
'src/**/*.html?(x)',
'src/**/*.json?(x)',
'!src/**/*.spec.js?(x)'
],
tests: [
'src/**/*.spec.js?(x)'
], ;
...
Alternatively, try excluding node_modules
(and all other folders with no tests/testable code in them):
...
files: [
'./**/*.js?(x)',
'./**/*.vue?(x)',
'./**/*.scss?(x)',
'./**/*.html?(x)',
'./**/*.json?(x)',
'!./**/*.spec.js?(x)',
+ '!node_modules/**'
],
tests: [
'./**/*.spec.js?(x)',
+ '!node_modules/**'
], ;
...
Thank you very much! I feel silly now I didn't think about it. I've excluded the node_modules folder, and it's actually working better.
I still cannot get rid of the decorators issue, though. Any ideas why it's not picking it up from my .babelrc file? Should I include them in my wallaby.js config file? Doing so gives me a path error.
Thanks again for the quick reply and the awesome help!
Your .babelrc
should be correctly loaded, so you don't need to specify your plugins in Wallaby config, however your dependencies install both babel 6 and babel 7, and looks like you are using Babel 6 (but Wallaby is trying to use the latest Babel 7), so you'll need to tell Wallaby which version of Babel to use:
compilers: {
'**/*.js': wallaby.compilers.babel({
+ babel: require('babel-core')
- 'plugins': [
- 'babel-plugin-transform-object-rest-spread',
- 'babel-plugin-transform-class-properties',
- 'babel-plugin-transform-decorators-legacy'
- ]
})
},
Yup, that was it! Looks like a chat with my team is in order about that clashing of dependencies...
Thanks a lot, this has been resolved!
Issue description or question
I cannot for the life of me run my project's tests in the Wallaby app, nor use Wallaby in any of my files.
We have a lot of tests in my project (about 325 test suits). I know it takes time, but Wallaby does not give any indication that it's actually running or passing (or failing) any tests. All I get is...
[Info] 2020-04-06T09:20:00.586Z uiService Outgoing message ui:busy [Info] 2020-04-06T09:20:00.586Z uiService Outgoing message ui:files [Error] Failed to handle 'fileAdded' event: not opened [Error] Failed to handle 'busy' event: not opened
...ad-infinitum. Maybe there's something wrong with my configuration, but I've tried everything, I've read all the documentation, all the issues. I just cannot set it up. I'm running a Vue project (4.1.2), with Jest (^23.6.0), no @babel/core, or anything else.
The only concrete error I get is about the decorators Babel plugin, saying:
Failed to run compilers on node_modules/prettier/parser-typescript.js, Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean. If you are migrating from Babylon/Babel 6 or want to use the old decorators proposal, you should use the 'decorators-legacy' plugin instead of 'decorators'.
In my .babelrc file, I have it configured like this:
"plugins": [ "babel-plugin-transform-object-rest-spread", "babel-plugin-transform-class-properties", "babel-plugin-transform-decorators-legacy" ]
Decorators are working in my project and tests, just not in Wallaby. I've tried naming them
transform-decorators-legacy
, which also is fine with the site and the tests, but not with Wallaby, and I've also tried adding them as babel plugins in the Wallaby config file, to no avail.I just don't know what else to do. I don't know if this is the issue or not. Quokka is telling me the same thing, so I can't use either. I tried updating to Jest 25, and also tried to use the non-legacy decorator proposal, but that pretty much breaks all the site, and my team won't be too happy about me messing around with dependencies (my team doesn't use Wallaby or Quokka).
Is there any way this can be fixed? Let me know what other information I can provide to help solve this matter.
As a last note, I can also not load the wallaby.js file from a custom path. It only lets me choose a folder, not a file, and even if I choose a folder with only that file, it won't pick up on it. I don't want to pollute my project's .gitignore with config files for resources I use (can't get the whole team to buy a license... yet...).
Wallaby diagnostics report