mobx icon indicating copy to clipboard operation
mobx copied to clipboard

Some cleanups of old stuff

Open mweststrate opened this issue 2 years ago • 2 comments

Code change checklist

  • [ ] Added/updated unit tests
  • [ ] Updated /docs. For new functionality, at least API.md should be updated
  • [ ] Verified that there is no significant performance drop (yarn mobx test:performance)

mweststrate avatar Nov 25 '23 15:11 mweststrate

⚠️ No Changeset found

Latest commit: 19836dde1d9bd02ee2cbdbf8e83174d1493285ee

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Nov 25 '23 15:11 changeset-bot[bot]

IIRC there were some tests in V4 that were relevant only for proxy: false (don't have an analog in V5) or had different expectations or required a bit different API to implement (object-api), would be nice to preserve these.

We should consolidate/rethink the behavior of resetGlobalState and it's usage in tests. For some time I've been using it to reset configure(...) at the end of a tests without realizing it actually doesn't reset everything. When I found out I went ahead and tried to change it, just to find out this would stop working: https://github.com/mobxjs/mobx/blob/55260aa158919033e862d219e60eea601a05ac61/packages/mobx/tests/v4/mobx4.ts#L3-L8 I also found a test that was passing only because a previous test did not revert the configuration to default. Ideally we should make sure tests can't have side-effects without the need to manually wrap them like so:

try { 
  /* test logic */
} finally { 
  configure({ foo: "You have to know the default for these set of tests" });
}

urugator avatar Nov 27 '23 10:11 urugator