-
-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade mocha #2177
Upgrade mocha #2177
Conversation
🦋 Changeset detectedLatest commit: 96758fc The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The breaking changes in v9
are where Dependabot failed us on this too, but since then it seems that Mocha has moved to v10
(npm listing). Would be great to move all the way through to that version, here.
For sure, I did that initially, but just had so much breakage that I thought I'd try to do this in smaller steps. Trying to figure out what breaks still 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this count as a breaking change? Likely.
Should we target #2180 for this PR?
Looks like you may just be missing these two https://github.com/koddsson/web/blob/update-mocha/package.json#L53-L68 and then the breaks of the change will open unto you? |
Yup! I've done this locally but didn't push it since it was broken. But I can push so we can all see the error in CI :) |
had a quick look, there's still something wrong but the first problem is this: web/packages/test-runner-mocha/src/mochaSetup.ts Lines 4 to 5 in 8999617
mocha 10's window object is a instead you can just do: class SilentReporter {
done() {
return;
}
} which is the interface of a reporter near enough so should solve that problem |
i think you need to still use the global since its testing that the setup worked correctly (i.e. its testing the but even then i think ci will fail 😭 |
@koddsson got it: const mocha = (window as any).mocha;
const mochaExports = (window as any).Mocha;
class SilentReporter extends mochaExports.reporters.Base {
} the exports got moved to if you're curious - it didn't work before because of a couple of things:
|
@43081j Let's hope this works! 🤞🏻 |
Amazing work here @43081j! I had done some changes with the |
Awesome, glad it worked! So the original code wasn't far off actually Pretty much |
Looks like we are all green! Let me know what you think, and feel free to merge at your own convenience. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exciting! Need to do a double check on a PC in the morning, but looking good. Nice merges we’ll get one last canary, and assuming there’s no issues, and no last minute feedback to the contrary, we’ll go to master
with the whole set of change! 🎊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This merge should auto release a new canary, and with a little testing there, maybe we're good to go?
Ecosystem wise, are most other people also leveraging this through @open-wc/testing-helpers
? Or is it just me? We'll need to update those as well.
Update Mocha from 8.2.1 to 10.2.0!