Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

145
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda