Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some cleanups of old stuff #3803

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Some cleanups of old stuff #3803

wants to merge 2 commits into from

Conversation

mweststrate
Copy link
Member

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)

Copy link

changeset-bot bot commented Nov 25, 2023

⚠️ No Changeset found

Latest commit: 19836dd

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

@urugator
Copy link
Collaborator

urugator commented Nov 27, 2023

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:

configure({
useProxies: "never",
enforceActions: "never"
})
export * from "../../src/mobx"

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" });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants