const sinon = require('sinon'); const assert = require('assert'); function exampleFunction() { console.log('Example'); } const spy = sinon.spy(exampleFunction); spy(); assert.calledOnce(spy); // passes spy(); assert.calledOnce(spy); // failsThis example uses Sinon's spy to first call `exampleFunction()` and then checks if the spy was called exactly once using `assert.calledOnce()`. The first assertion passes because the spy was called once, but the second assertion fails because the spy was called twice. Package Library: The package library for Sinon is 'sinon'.