karma-sinon
    Overview
    Documentation
    Code
    Playground
    Issues
    Insights
    Contributors
    Dependencies
    Versions
    Alternatives

karma-sinon

Sinon for Karma

1.0.5  •  Published 3 years ago  •  by Janusz J  •  Unknown License

karma-sinon

Sinon for karma

Installation

Install the module via npm

$ npm install karma-sinon 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();
    });

});

Popularity

Weekly Downloads
68.9K
Stars
30

Maintenance

Development

Last ver 3 years ago
Created 6 years ago
Last commit 1 year ago
3 months between commits

Technology

Node version: 4.3.1
0 unpacked

Legal and Compliance

License Unknown
Not OSI Approved
0 vulnerabilities

Contributors

4 contributors
Janusz Jablonski
Maintainer, 16 commits, 2 merges
Jemuel Young
1 commits, 1 PRs
Works at Netflix NetflixUI FrontEndHappyHour
André Gil
1 commits, 1 PRs
Janusz Jablonski
1 commits
rickyclegg
1 PRs
mruzekw
1 PRs

Dependencies

Tags

karma
karma-plugin
sinon
mock