Open karlismelderis opened 3 years ago
Hi @karlismelderis
This plugin is for chai-js-style asserts like this:
expect(true).to.be.true;
It is useless for Jest-style asserts so just remove/disable the plugin.
Due to historical decisions we're using chai assertions in Jest
So .exist
, .true
and other chai syntax still exist in our test files
but chai do not have .disabled
(it's only part of chai-jquery
and we don't have it installed)
@karlismelderis I see. The linter is not aware of chai plugins, so the best we can do is to add a configurable whitelist of chai asserts. Will look into it this weekend.
I caught that due to this lint rule setup:
Things like this pass through:
.to.be.disabled
Where syntax should be:
.to.be.disabled()
As we don't have any plugin that has such .disabled implementation but do have .disabled().
Issue is that Jest just moves on happily and marks tests as green irrelevant of syntax.
no-unused-expressions
and IntelliJ code inspection is able to detect this error.