-
-
Notifications
You must be signed in to change notification settings - Fork 770
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/cjsify sinon sandbox tests #1088
Feature/cjsify sinon sandbox tests #1088
Conversation
Removes all `sinon.*` references from the test suite bar the fakes.
Had to skip a couple of tests were were testing the implementation of lolex.
}); | ||
|
||
it("passes arguments to sinon.useFakeTimers", function () { | ||
var stub = sinon.stub(sinon, "useFakeTimers").returns({ restore: function () {} }); | ||
// Not sure how we can test this without monkey-patching or testing the implementation of lolex. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the problem with the commented out code? Looks like that should do ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I stubbed useFakeTimers
it cause a bunch of assertion failures in other modules, almost as if the clock stub was not being restored. Let me try it again and see if I can get to the root of that issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There have been a few fixes in lolex
related to Date
and timers recently, so maybe try upgrading to 1.5.1
and see if that helps? I could also help out if you are short on time.
ec19f89
to
655661b
Compare
Pretty straight forward, removed 3 tests which were focused around the deprecated `sandbox.useFakeXMLHttpRequest()` API, the comment above them implied they were flakey anyway...
655661b
to
7a90c5f
Compare
@fatso83, @mantoni managed to resolve this by simply using a stub instead of a spy; before doing this I tried installing 1.5.0 of lollex (which didn't help) and I rewrote the 2 failing My hope is that this kind of weird flakiness falls out from the suite once the last of the modules are cjsified... :) |
LGTM |
🚢 |
Remove
sinon.*
references fromsandbox
and its test suite! 🚀This PR represents the last "core" sinonJS module that needed to be migrated 🎉 There were a few of minor casualties in the test-suite, namely 3 tests around the deprecated(?)
sandbox.useFakeXMLHttpRequest()
API (which just call through to theuseFakeServer()
API anyway...)