Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

138
Views
Does dirty-chai not error when not using function call form of property access?

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?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!