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

to have calls satisfying bug with sinon v7.2.4 #92

Closed
joelmukuthu opened this issue Feb 19, 2019 · 1 comment
Closed

to have calls satisfying bug with sinon v7.2.4 #92

joelmukuthu opened this issue Feb 19, 2019 · 1 comment

Comments

@joelmukuthu
Copy link
Member

Hi,

I have this failing build with sinon v7.2.4 (it was passing with v7.2.3):

TypeError: Cannot read property 'length' of undefined
      at /home/travis/build/knorm/knorm/node_modules/unexpected-sinon/lib/unexpected-sinon.js:155:39
      at Array.forEach (<anonymous>)
      at recordSpyCalls (node_modules/unexpected-sinon/lib/unexpected-sinon.js:153:11)
      at Object.handler (node_modules/unexpected-sinon/lib/unexpected-sinon.js:658:38)
      at executeExpect (node_modules/unexpected/build/lib/Unexpected.js:1300:65)
      at Unexpected.expect (node_modules/unexpected/build/lib/Unexpected.js:1304:18)
      at expect (node_modules/unexpected/build/lib/Unexpected.js:929:23)
      at Context.<anonymous> (test/Field.spec.js:118:9)

PR for that build here

The test:

describe('without a column name configured', function() {
  it("calls getColumnName to set the field's column name", function() {
    class Foo extends Model {}
    const stub = sinon
      .stub(Field.prototype, 'getColumnName')
      .returns('the column name');
    const field = new Field({
      name: 'bar',
      model: Foo,
      type: 'string'
    });
    expect(stub, 'to have calls satisfying', () => {
      stub('bar');
    });
    expect(field.column, 'to be', 'the column name');
    stub.restore();
  });
});

I'm not sure but it looks like these changes might be causing the issue sinonjs/sinon#1975.

Let me know if I should provide any more info.

@papandreou
Copy link
Member

Thanks! Fixed in 10.11.1.

You were right that it was due to the enumerability change.

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