ingameio / SinonES6.JS

Test spies, stubs and mocks for JavaScript ES6.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SinonES6.JS

Sinon.js version compatible with ES6. Everything is like the original version of sinon, plus generators mocking.

var sinon = require('sinon-es6');

var objectToMock = {
    generator: function* (a, b) { yield ... }
};

sinon.mock(objectToMock).expects('generator').withArgs(2,3).returns(6);

All credits to @cjohansen and Sinon.JS contributors.

About

Test spies, stubs and mocks for JavaScript ES6.

License:Other


Languages

Language:JavaScript 98.5%Language:CSS 1.2%Language:Ruby 0.2%Language:Shell 0.0%