Closed IT-CASADO closed 2 years ago
It looks like right now Wallaby's webpack integration doesn't support what you're trying to do with Monaco editor and how it loads/runs.
This is going to require a deeper investigation by our team. We'll look at it next week and get back to you.
Our team has spent most of the day investigating your issue and it looks like the fact that it's working for you may be a bug or problem with nx
caching.
When we originally ran yarn test code-editors
it was working for us but we think that the result was a cached version of a previous test that had previously passed. When we run:
yarn test code-editors --skip-nx-cache
The tests always fail. We tried running npx nx run-many --target=test --all
and then for some reason the tests start passing after multiple executions. We're not sure why.
We need you to check whether
yarn test code-editors --skip-nx-cache
is also failing for you?
If so, we need you to fix the project so that these tests pass without using the cache before we can continue troubleshooting. Once they're working, you can try Wallaby again and it may work without any issues. If it doesn't work, at least we will understand how your project works from the command-line and will be able to proceed with troubleshooting Wallaby.
Skipping NX cache on my side doesn't change anything for me (same for one of my colleague). All test are always green (success) with Karma. No matter how often I run the tests....
Okay, I just cloned and run the project on my private machine and curiously I see immediately 3 of 7 tests failing.
And furthermore on this machine it is ongoing repeatable both with
yarn test code-editors --skip-nx-cache
and also with
yarn test code-editors
.
Need to do more investigation on this (although I don't really know where to start ;))
although I don't really know where to start
I'm guessing that somewhere someone else has configured NX to run/test with Monaco. The webpack plugin I saw in your project looked like it was what you might have needed (i.e. custom webpack configuration).
It's a little outside providing standard support, but if you can't work it out in a day or two, let us know and someone in our team can take a look for you. Would probably take a day or two for us to work out.
I noticed that I see those errors also permanently on my work machine when I run this:
yarn test code-editors --skip-nx-cache --watch
Side note: To prevent caching issues I opened browser developers tools for Karma window ;)
Now I'm applying the same custom webpack config to all Karma tests and all tests run now fine with Karma.
Unfortunately Wallaby is still showing me failing tests.
Quick update on this issue for you @IT-CASADO. We have been investigating why Wallaby isn't working for you.
Unfortunately Monaco
does not support loading workers on the main thread at the moment. On the other hand, Wallaby
does not support running code outside of the main thread, there are several limitations with our Webpack
integration and coverage collecting issues for the code running in a worker context.
Therefore our recommendation is to mock ITextModel
and IStandaloneCodeEditor
in your tests to make them less integration tests but more unit tests. Additionally you may also exclude the tests which load Monaco
from Wallaby
execution.
Issue description or question
I'm trying to use the monaco-editor in an angular app. Unfortunately I'm getting following error while running tests with wallaby. This error itself is coming from Monaco-Editor.
But if I run the same tests with Karma I don't get any errors.
Repro steps:
I don't know if this issue is only related to Wallaby or also something with Monaco-Editor. It seems that Monaco is using some hacks with ESM comments.
Do you expect that my tests should also run in wallaby with automatic configuration?
Wallaby diagnostics report