untitled notebook

node v18.11.0
version: master
endpointsharetweet
require("@fatso83/mini-mocha").install(); const sinon = require("sinon"); const referee = require("@sinonjs/referee"); const assert = referee.assert; describe("stub", function () { it("overrides return value of a stub", function () { const callback = sinon.stub(); callback.withArgs(42).returns(1); callback.withArgs(42).returns(24); assert.equals(callback(42), 24); }); });
Created from: https://sinonjs.org/releases/latest/stubs/
Loading…

no comments

    sign in to comment