-
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
dirty-chai and chai-enzyme clashing? #17
Comments
The following also fails when watching let Comp = () => <div className="hello">hello world</div>
describe('Test', () => {
it('should contain text', () => {
const wrapper = shallow(<Comp />)
expect(wrapper).to.contain.text("world");
})
})
@devboell I also have seen it fail on start, can't make a minimal reproduction of failing on first run either, but my application does have that failure. |
My hypothesis is that it has to do with The following repro works when run from node (4) directly:
Out:
For me, switching the order of the imports fixes the problem:
|
I also had a problem with the combinatino of chai-as-promised and sinon-chai. doing:
fixed the issue, which is strange, as the readme explicitly says the use sinonChai before dirtyChai.... BUT then I get other problems. It seems that dirtyChai can't work together with certain combinations of other packages..... |
The method we use to detect, modify, and hook assertion properties is necessarily a little non-deterministic because of the dynamic way Chai's plugin system works. Unfortunately we can't address issues like these classes without testing and possibly customization of some logic discriminated by the target plugin. There are so many plugins that this may be a never-ending task, but perhaps there are a few changes that can make this more compatible. For issues like this I've been tracking some major changes that Chai is planning to make. There have been some discussions about making assertion styles pluggable, but I believe that would come after some major plugin refactoring they have been hashing out for quite awhile in chaijs/chai#585. I'm going to close and track this work in the more generic #32. Thank you for the discussion! |
Hi,
I came across some glitches when using chai-enzyme and dirty-chai together.
This small repo explains it, and has code that reproduces the bug:
https://github.com/devboell/chai-enzyme-error.git
I have also seen it occur without mocha in watch mode, but I can't reproduce it.
Would you please let me know if you can reproduce the error on your machine? If only for my sanity's sake :)
thanks
The text was updated successfully, but these errors were encountered: