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

Remove const sandbox = sinon.createSandbox(); from examples unrelated to sandbox. #2594

Closed
DanKaplanSES opened this issue May 5, 2024 · 1 comment

Comments

@DanKaplanSES
Copy link
Contributor

DanKaplanSES commented May 5, 2024

Is your feature request related to a problem? Please describe.
Many of the examples start with const sandbox = sinon.createSandbox(); and then use that sandbox object. According to the sandbox documentation, "Since Sinon 5, the sinon object is a default sandbox in itself! Unless you have a very advanced setup or need a special configuration, you probably only need to use that one in your tests for easy cleanup."

If the reader doesn't read this quote, the examples imply that you should use const sandbox = sinon.createSandbox(); in your tests, too.

Describe the solution you'd like
I'd like the non-sandbox examples to remove sandbox from their code.

Describe alternatives you've considered

  1. This issue could be closed without change.
  2. I suppose a comment could be added to every one of these lines to say // or use sinon instead?

Additional context
I'm willing to create a PR for this. I just wanted to make sure it is a good idea before I attempt to.

@fatso83
Copy link
Contributor

fatso83 commented May 7, 2024

This is absolutely correct. I just had to understand what you were talking about. Seeing that it was just a handful of examples, I just fixed it :)

@fatso83 fatso83 closed this as completed in c618edc May 7, 2024
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

2 participants