-
Notifications
You must be signed in to change notification settings - Fork 18
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
Loading dirty-chai before chai-jquery breaks empty() #11
Comments
FWIW, while using the |
Sorry guys, dirty-chai does hook the internal methods that plugins use to extend chai in order to convert assertions to methods. I do have an outstanding PR with tests that work a problem with a similar issue to this. Perhaps the guidance should just be changed to run dirty-chai last instead of first. Hopefully this will get less hairy with extendable assertion formats that are supposed to come in a newer chai. I'll be tracking this in #7. |
I'm running into the same issue with chai-fs, although I can't fix the I've tried every permutation of the following lines, but nothing works: const chaiFS = require('chai-fs')
const dirtyChai = require('dirty-chai')
chai.use(dirtyChai)
chai.use(chaiFS) It seems that once you use I've gotten around this by using the property form of
|
The readme stated that dirty-chai should be loaded before any other plugins, but I found that if I load dirty-chai before chai-jquery, a
should.be.empty()
throws aTypeError: empty is not a function
.However, if I load chai-jquery before dirty-chai, the said problem is gone, and what's more, the property assertions in chai-jquery actually convert to method assertions.
The text was updated successfully, but these errors were encountered: