mobxjs / mobx-state-tree

Full-featured reactive state management without the boilerplate
https://mobx-state-tree.js.org/
MIT License
6.9k stars 640 forks source link

Fix missing fail import #2137

Closed k-ode closed 4 months ago

k-ode commented 5 months ago

What does this PR do and why?

Fixes a missing import that would crash types.snapshotProcessor on usage.

The reason it wasn't caught by typescript is that it assumed fail was a built-in jest function.

coolsoftwaretyler commented 5 months ago

Thanks @k-ode! Makes sense. We have seen this in a few places before.

If you have a chance, would you mind writing a test case for this? We recently made that a PR requirement and I'd love to protect against regressions on this.

k-ode commented 4 months ago

@coolsoftwaretyler Added a test case.

coolsoftwaretyler commented 4 months ago

Thanks @k-ode! Merging now and I'll push a patch.

I've also added a new issue to fix this across the whole project. We've seen it before: https://github.com/mobxjs/mobx-state-tree/issues/2138