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

Incompatible with chai 3.4.0? #4

Closed
elado opened this issue Oct 27, 2015 · 2 comments
Closed

Incompatible with chai 3.4.0? #4

elado opened this issue Oct 27, 2015 · 2 comments

Comments

@elado
Copy link

elado commented Oct 27, 2015

var x = 0;

expect(function() { x += 1; }).to.change(function() { return x });
expect(function() {     }).not.to.change(function() { return x });

error:

AssertionError: expected [Function] to have a property undefined
at Assertion.assertChanges (node_modules/chai/lib/chai/core/assertions.js:1604:40)
at Assertion.assert (node_modules/chai/lib/chai/utils/addChainableMethod.js:83:49)
@timruffles
Copy link
Member

Thanks for reminding me.

Yes - unfortunately chai added a not great change implementation of its own.

Will put in a helpful error message when used with chai 1.x

On Tuesday, 27 October 2015, Elad Ossadon notifications@github.com wrote:

var x = 0;

expect(function() { x += 1; }).to.change(function() { return x });
expect(function() { }).not.to.change(function() { return x });

error:

AssertionError: expected [Function] to have a property undefined
at Assertion.assertChanges (node_modules/chai/lib/chai/core/assertions.js:1604:40)
at Assertion.assert (node_modules/chai/lib/chai/utils/addChainableMethod.js:83:49)


Reply to this email directly or view it on GitHub
#4.

@timruffles
Copy link
Member

Fixed in 2.0.0 :)

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