Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Sinon for karma
JavaScript
Branch: master

v1.0.4

latest commit 5a005cb5d9
@yanoosh authored
Failed to load latest commit information.
.npmignore Added npm ignore.
LICENSE Added license. Increased version.
README.md Add installation information
index.js Fixed path.
package.json v1.0.4

README.md

karma-sinon

Sinon for karma

Installation

Install the module via npm

$ npm install karma-sinon --save-dev

Add sinon to the frameworks key in your Karma configuration:

module.exports = function(config) {
  'use strict';
  config.set({
    #...
    frameworks: ['jasmine', 'sinon'],
    #...
  });
}

Example

describe("sinon example test", function () {
    var time2013_10_01;

    time2013_10_01 = (new Date(2013, 10-1, 1)).getTime();

    before(function() {
        // sinon was defined in global scope
        this.fakeTimer = new sinon.useFakeTimers(time2013_10_01);
    });

    it("some test", function() {
        //test
    });

    after(function() {
        this.fakeTimer.restore();
    });

});
Something went wrong with that request. Please try again.