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 sinon sandboxes #788

Merged
merged 3 commits into from
Apr 21, 2022
Merged

Remove sinon sandboxes #788

merged 3 commits into from
Apr 21, 2022

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Apr 20, 2022

Sinon uses the "default sandbox" by default, and this is sufficient for everything we are using Sinon for. People tend to use the createSandbox method because they misunderstand how sandboxes work. This often results in interwoven use of a module-specific sandbox and the default sandbox, which leads to errors.

Instead we should use the default sandbox and restore it after each test.

Sinon uses the "default sandbox" by default, and this is sufficient for
everything we are using Sinon for. People tend to use the
`createSandbox` method because they misunderstand how sandboxes work.
This often results in interwoven use of a module-specific sandbox and
the default sandbox, which leads to errors.

Instead we should use the default sandbox and restore it after each
test.
@Gudahtt Gudahtt marked this pull request as ready for review April 20, 2022 19:12
@Gudahtt Gudahtt requested a review from a team as a code owner April 20, 2022 19:12
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point we should replace Sinon mocks with Jest mocks, but, this looks good as an incremental change.

@Gudahtt Gudahtt merged commit 7221c69 into main Apr 21, 2022
@Gudahtt Gudahtt deleted the remove-sinon-sandboxes branch April 21, 2022 22:33
@Gudahtt
Copy link
Member Author

Gudahtt commented Apr 21, 2022

Agreed! Just trying to get Sinon to behave more like Jest will before we switch them.

MajorLift pushed a commit that referenced this pull request Oct 11, 2023
Sinon uses the "default sandbox" by default, and this is sufficient for
everything we are using Sinon for. People tend to use the
`createSandbox` method because they misunderstand how sandboxes work.
This often results in interwoven use of a module-specific sandbox and
the default sandbox, which leads to errors.

Instead we should use the default sandbox and restore it after each
test.
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
Sinon uses the "default sandbox" by default, and this is sufficient for
everything we are using Sinon for. People tend to use the
`createSandbox` method because they misunderstand how sandboxes work.
This often results in interwoven use of a module-specific sandbox and
the default sandbox, which leads to errors.

Instead we should use the default sandbox and restore it after each
test.
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.

2 participants