Skip to content

jameskeane/karma-jasmine-sinon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

karma-jasmine-sinon

jasmine-sinon for karma

Installation

Install the module via npm

$ npm install karma-jasmine-sinon --save-dev

Add jasmine-sinon to the frameworks key in your Karma configuration:

module.exports = function(config) {
  'use strict';
  config.set({
    #...
    frameworks: ['jasmine', '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();
    });

});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published