Untitled
unknown
plain_text
2 years ago
605 B
9
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();
});
Editor is loading...
Leave a Comment