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

Feature request: reset specific module(s) #520

Open
JakobJingleheimer opened this issue Oct 17, 2023 · 1 comment
Open

Feature request: reset specific module(s) #520

JakobJingleheimer opened this issue Oct 17, 2023 · 1 comment

Comments

@JakobJingleheimer
Copy link

JakobJingleheimer commented Oct 17, 2023

It would be great if td.reset() optionally accepted a list of modules to reset, like:

td.reset(); // nuclear option → reset everything

td.reset('module-a.js');
td.reset(
  'module-a.js',
  'module-b.js',
);

The problem this solves is avoiding erroneously blowing away global mocks: a particular test may need to mock a specific module; after that test runs, only the module(s) it itself mocked should be reset.

@JakobJingleheimer
Copy link
Author

Gentle nudge

If you're low on capacity but the feature is acceptable, I can try to implement it.

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

No branches or pull requests

1 participant