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
sinon-test issue 101
node v10.24.1
version:
4.0.4
endpoint
share
tweet
// Runnable example of a supposed issue with `sinon-test` // Employs 'mini-mocha' to emulate running in the Mocha test runner (mochajs.org) // @author Carl-Erik Kopseng require("@fatso83/mini-mocha").install(); const sinon = require("sinon"); const sinonTest = require("sinon-test"); const test = sinonTest(sinon); describe("issue #101 ES2015 version", function() { class MyClass { static myMethod() { return "originalReturn"; } } it("test 1", test(function() { sinon.stub(MyClass, "myMethod"); })); it("test 2", test(function() { sinon.stub(MyClass, "myMethod"); })); }); describe("issue #101 ES5 version", function() { var Foo = { myMethod: function() { return "original"; } } it("test 1", test(function() { sinon.stub(Foo, "myMethod"); })); it("test 2", test(function() { sinon.stub(Foo, "myMethod"); })); });
Runnable example of a supposed issue (#101) with `sinon-test` Employs 'mini-mocha' to emulate running in the Mocha test runner (mochajs.org)
Loading…
no comments
sign in
to comment