Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
untitled notebook
node v18.11.0
version:
master
endpoint
share
tweet
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