chai
chai copied to clipboard
expect().should should warn
I think, this is a good idea to warn because when someone types lots of ordinary .should assertions
message.id.should.be.equal(...);
message.user_id.should.be.equal(...);
and then suddenly they need to insert expect() assertion, it's easy to automatically type
expect(message.text).should.be.equal('test');
instead of
expect(message.text).to.be.equal('test');
When this happens, the error looks like this:
AssertionError: expected { Object (__flags) } to equal 'test'
Which looks like the message.text field is a strange object and can lead the developer on the wrong path.
Sounds like a task for https://github.com/turbo87/eslint-plugin-chai-expect.