salesforce / sfdx-lwc-jest

Run Jest against LWC components in SFDX workspace environment
MIT License
162 stars 81 forks source link

fix: update dependencies, including jest #335

Closed nolanlawson closed 1 year ago

nolanlawson commented 1 year ago

BREAKING CHANGE: Jest updated from v27 to v28

Fixes #319

Updates all dependencies, including Jest. Users of sfdx-lwc-jest may need to modify their tests to deal with breaking changes in Jest 28 and Jest 29.

nolanlawson commented 1 year ago

This should probably be tested on a sample project before merging. I just tried it on a small project and it immediately failed due to an issue with jest-environment-jsdom.

nolanlawson commented 1 year ago

OK, I tested lwc-recipes manually, and it works with this PR. (I wanted to avoid issues we saw with https://github.com/salesforce/sfdx-lwc-jest/issues/288). The above-mentioned issue with jest-environment-jsdom is also fixed.

I also tested --coverage, and coverage actually works better than before – apparently using .js excludes files that are imported with bare file extensions. In the lwc-recipes repo, --coverage finds many more files than it did previously.