Repository navigation
Migrate Jest test setup from CommonJS to ESM - #1977
LanieOkorodudu wants to merge 2 commits into
Conversation
|
@LanieOkorodudu is attempting to deploy a commit to the Universal Viewer Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thanks, @LanieOkorodudu, this definitely is a bit more readable overall. I see some things aren't working yet; please let me know if you need any help with anything! |
|
I've added a package.json with |
demiankatz
left a comment
There was a problem hiding this comment.
Thanks, @LanieOkorodudu, this all makes sense to me, and tests are passing... so the only remaining question is when we want to take it out of draft and merge it. Maybe a topic for a future Community Call. I'll put this on the community board "in testing" so we don't forget about it.
I can remove it from draft for now and wait for community call to discuss it if we want to merge it, I also requested @K8Sewell to review it as well. Thanks for your time looking into this @demiankatz |
Pull request description
This PR migrates the Jest test setup and Puppeteer tests from CommonJS to ESM.
Following the Puppeteer 25 upgrade, the tests were using a mixture of CommonJS and dynamic ESM imports. The aim of this migration was to remove the need for --experimental-vm-modules and make the test setup more consistent.
However, after further investigation, Jest 30 still requires --experimental-vm-modules to run native ESM tests, so the flag has been retained for now.
This is a draft PR to gather feedback from the team on whether the ESM conversion makes sense.
Summary of changes
Related issues
#1899
Contributor checklist
Accessibility & internationalisation
Compatibility & interoperability
Code quality & testing
Configuration & documentation
Additional notes for reviewers:
The tests are passing on my local machine, but they're still failing in CI. I'm wondering if this might be because I'm using Node 24 locally, while CI runs on Node 22.
I'll look into this a bit more and see what's causing the failures.