Properly resolve Mocha when using browser-runner#11366
Properly resolve Mocha when using browser-runner#11366christian-bromann merged 4 commits intowebdriverio:mainfrom
Conversation
christian-bromann
left a comment
There was a problem hiding this comment.
@FrederikBolding it seems this is failing in CI, Mocha can't be found, does it work locally for you?
Yes, this does work locally. I had forgotten to push up the updated snapshot, I just did that! |
|
Looks like it only failed on Windows, perhaps some platform specific issue 🤔 |
|
@FrederikBolding yes, this error:
basically says that it couldn't load the Mocha library. I recommend to use https://github.com/stateful/vscode-server-action and debug the case in CI (if you don't have a Windows machine). |
|
@christian-bromann Latest commit seems to work locally on both Windows and Mac OS, I've also ran it through CI on my fork. |
|
Hello! I had patched our with this version I get:
Just FYI. But we're in the inception of our component testing using these tools so maybe our config or setup is incorrect. @FrederikBolding @christian-bromann |
|
@axeleriksson147 can you share maybe a minimal reproducible example? Happy to take a look to get you up and running. BTW this patch is not yet released but from what I read from the comment you applied the changes manually? |
|
@christian-bromann 🤦 🤦 I thought I saw this commit part of the |
Proposed changes
Applies the fix described in #11003 to properly resolve Mocha when using the browser-runner in a subdirectory.
It seems that Vite is not properly resolving the references to Mocha described in the template and this workaround fixes it. There may be a better solution for this problem that changes configuration in Vite to improve the module resolution, but I am not experienced enough with Vite to know where to start with that. This fix however, solves the immediate problem.
Fixes #11003
Types of changes
Checklist
Further comments
Reviewers: @webdriverio/project-committers