sinon-test issue 101

node v10.24.1
version: 4.0.4
endpointsharetweet
// 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