microsoft / just

The task library that just works
https://microsoft.github.io/just
MIT License
1.95k stars 92 forks source link

Update to Jest 27 #695

Closed ecraig12345 closed 1 year ago

ecraig12345 commented 1 year ago

Update to Jest 27 to get a resolver version that supports node: syntax for built-ins, to unblock marked-terminal update (#662).

Initially a few tests were failing with ENOENT: no such file or directory, lstat '<repo path>/node_modules/jest-worker/build/index.js'. I figured out this was because Jest 27 sometimes tries to delay-load jest-worker in the test result reporting stage, which caused errors in tests using mock-fs if they didn't call mockfs.restore() after each test. So the fix is to update the tests to restore in afterEach.

I also added proper launch configurations for debugging tests, and removed a custom internal Jest reporter that was intended for Azure DevOps builds with failOnStderr (or maybe it was from further back when this repo used Rush) and isn't needed now.