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

Add test for issue #1026 #1030

Merged
merged 3 commits into from
Dec 27, 2016
Merged

Conversation

mroderick
Copy link
Member

Purpose

This is a PR for v1.17 branch, it adds a failing test case for #1026

How to verify - mandatory

  1. Check out this branch (see github instructions below)
  2. npm install
  3. npm test
  4. Observe the magnificence of the failing test case

@fatso83
Copy link
Contributor

fatso83 commented Apr 19, 2016

Should I merge this before we have a working fix? That would leave a broken master.

@mroderick
Copy link
Member Author

Should I merge this before we have a working fix? That would leave a broken master.

I would say no, this is a minor issue that's been around for years.


assert.isArray(stubbedObject.watch.args);

if (oldWatch) {
Copy link
Member

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.

@mroderick mroderick force-pushed the add-test-for-issue-1026 branch 2 times, most recently from 22734c1 to 56edcec Compare November 9, 2016 10:43
@mroderick
Copy link
Member Author

@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 Review: commit, and merge this.

@mroderick
Copy link
Member Author

Once we merge this, we will have to port the fix to master also

@fatso83
Copy link
Contributor

fatso83 commented Dec 17, 2016

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
@fatso83
Copy link
Contributor

fatso83 commented Dec 17, 2016

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

@mroderick mroderick force-pushed the add-test-for-issue-1026 branch from 56edcec to 2f04613 Compare December 27, 2016 16:05
@mroderick
Copy link
Member Author

Thanks @fatso83, I've applied the rebased version from your branch

@mroderick mroderick merged commit 45900b8 into sinonjs:v1.17 Dec 27, 2016
@mroderick mroderick mentioned this pull request Dec 27, 2016
@mroderick mroderick deleted the add-test-for-issue-1026 branch October 11, 2017 08:49
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.

3 participants