-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Add test for issue #1026 #1030
Add test for issue #1026 #1030
Conversation
Should I merge this before we have a working fix? That would leave a broken |
I would say no, this is a minor issue that's been around for years. |
|
||
assert.isArray(stubbedObject.watch.args); | ||
|
||
if (oldWatch) { |
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.
None of this is guaranteed to be reached it the test fails.
22734c1
to
56edcec
Compare
@fatso83 @fearphage I've added a few commits to this, I believe it is complete and fixes #1026. If you agree, then I'd like to squash the |
Once we merge this, we will have to port the fix to |
Morgan, were you supposed to squash the review commit before I merged this? |
The previous test only worked because of a faulty implementation in our source, once that is fixed, this test will fail, because we walk ALL own properties. Instead, this test has been rewritten to ensure that each property is only examined once, by looking at what property names have been used.
This is the fix proposed by @ajdaniel in [1]. Now that we have corrected the faulty "does not walk the same property twice" test in the previous commit, this solution does cause that test to (incorrectly) fail. [1]: sinonjs#1026
Rebased in my branch: $ git remote add fatso83 git@github.com:fatso83/sinon.git
$ git fetch fatso83
$ git log --oneline -n3 fatso83/add-test-for-issue1026
2f04613 Fix #1026: stub watch method on object
33d7326 Fix invalid test for "does not walk the same property twice"
9d6ae3b Add test for issue #1026
$ git reset --hard fatso83/add-test-for-issue-1026 |
56edcec
to
2f04613
Compare
Thanks @fatso83, I've applied the rebased version from your branch |
Purpose
This is a PR for v1.17 branch, it adds a failing test case for #1026
How to verify - mandatory
npm install
npm test