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

Latest release of expect is breaking Redux build #51

Closed
ellbee opened this issue Dec 10, 2015 · 2 comments
Closed

Latest release of expect is breaking Redux build #51

ellbee opened this issue Dec 10, 2015 · 2 comments

Comments

@ellbee
Copy link

ellbee commented Dec 10, 2015

Seems to be a problem with object key ordering.

    // This fails:
    expect(
      [
        {
          type: types.COMPLETE_TODO,
          id: 0
        }, {
          type: types.CLEAR_COMPLETED
        }, {
          type: types.ADD_TODO,
          text: 'Write more tests'
        }
      ].reduce(todos, [
        {
          id: 0,
          completed: false,
          text: 'Use Redux'
        }, {
          id: 1,
          completed: false,
          text: 'Write tests'
        }
      ])
    ).toEqual([
      {
        text: 'Write more tests',
        completed: false,
        id: 2
      }, {
        text: 'Write tests',
        completed: false,
        id: 1
      }
    ])

   // Changing the key order in the argument of `toEqual` as follows passes:
   expect(
      [
        {
          type: types.COMPLETE_TODO,
          id: 0
        }, {
          type: types.CLEAR_COMPLETED
        }, {
          type: types.ADD_TODO,
          text: 'Write more tests'
        }
      ].reduce(todos, [
        {
          id: 0,
          completed: false,
          text: 'Use Redux'
        }, {
          id: 1,
          completed: false,
          text: 'Write tests'
        }
      ])
    ).toEqual([
      {
        id: 2,
        completed: false,
        text: 'Write more tests'
      }, {
        id: 1,
        completed: false,
        text: 'Write tests'
      }
    ])

Could be due to this issue in the new is-equal library

@ljharb
Copy link
Collaborator

ljharb commented Dec 10, 2015

This is now fixed and released in is-equal v1.3.1. Sorry about that!

@ellbee
Copy link
Author

ellbee commented Dec 11, 2015

Yep, all good now. Thanks @ljharb.

@ellbee ellbee closed this as completed Dec 11, 2015
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