Untitled

 avatar
unknown
plain_text
a year ago
605 B
4
Indexable
const sinon = require('sinon');
const { assert } = require('chai'); // Ou qualquer outra biblioteca de asserção que você esteja usando

// Seu código de teste aqui

it('deve verificar se res.json foi chamado com o valor correto', function() {
    // Seu código de configuração de stub e teste aqui

    sinon.assert.calledWith(res.json, matche);
});

it('deve verificar se todosOsMatchsStub foi chamado exatamente uma vez', function() {
    // Seu código de configuração de stub e teste aqui

    sinon.assert.calledOnce(todosOsMatchsStub);
    todosOsMatchsStub.restore();
});
Leave a Comment