chaijs / chai-spies

Spies for Chai Assertion Library.
MIT License
132 stars 29 forks source link

to.have.been.called.with() throws an error #78

Closed Bartosz-D3V closed 6 years ago

Bartosz-D3V commented 7 years ago

Hi there,

I have a small issue with chai spies.

import * as spies from 'chai-spies';
const assert = chai.assert;
const expect = chai.expect;

beforeEach(() => {
chai.use(spies);
spy = chai.spy.on(component.change, 'emit');
});

it('should have been called with string foo', () => {
expect(spy).to.have.been.called.with('foo');
});

When invoking the above code I receive an error:

Error: Invalid Chai property: _his. Did you mean "is"?
at Object.proxyGetter [as get] (node_modules/chai/chai.js:9105:17)

I don't have any problems with running other functions so far like to.have.been.called.once/twice etc.

Is it a known issue? I use chai version 4.0.2 and chai-spies version 0.7.1

stalniy commented 7 years ago

Duplicates #71

Update: Fixed in #77 waiting for review from @keithamus

shellscape commented 7 years ago

@Bartosz-D3V I've published chai-spies-next that you can use in the meantime. It was actually rather trivial to fix folio to run a build so I'm not sure why that's been blocking on a new build.

stalniy commented 6 years ago

Fixed in 1.0.0