Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

140
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda