I've recently installed dirty-chai, which states:
The following built-in assertions are modified by this plugin to now use the function-call form:
The idea being, that hopefully, we get a fail in a test trying to run expect(true).to.be.true as it doesn't call the final property being accessed as a function.
But writing that test, gives me no such test failure.
I do note that the same doc also says:
These forms can also be mixed, but the chain must always be terminated in the function form or assertions up to that point in the chain will not execute.
emphasis mine
However I have the code running with all of the below, and no test failures:
expect(true).to.be.true;
expect(true).to.be.ture;
expect(true).to.be.true();
I have dirty-chai installed like so, with Mocha 9.1.2, Chai 4.1.2, and the latest version of dirty-chai:
const Chai = require('chai');
const dirtyChai = require('dirty-chai');
....
Chai.use(dirtyChai);
this is all wrapped up in a javascript file that's passed to mocha via mocha <other options> -r ./test/chaiPlugins.js
Is dirty-chai not behaving as expected, or am I expecting it to behave in a way it doesn't?