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

TypeError: Property 'true' of object [object Object] is not a function #326

Closed
gajus opened this issue Dec 15, 2014 · 1 comment
Closed

Comments

@gajus
Copy link

gajus commented Dec 15, 2014

Documentation:

Can also be used as a function, which prevents some linter errors.
expect(true).to.be.true();

http://chaijs.com/api/bdd/

However, executing:

var expect = require('chai').expect;
expect(true).to.be.true();

Gives:

TypeError: Property 'true' of object [object Object] is not a function

The only variation that I found to work (in function call format) is:

expect(true).to.equal(true);
@keithamus
Copy link
Member

Hi @gajus, thanks for the issue. Are you using Chai 1.10? It is the only version of Chai with that feature. Sadly though, it'll have to be removed in the next Chai release because it breaks some existing code. Having said that, there is a plugin available called dirty-chai which overrides the behaviour, I'd recommend using that.

For reference: this is a duplicate of #321 which contains the same information.

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