🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

karma-sinon

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-sinon

Sinon for Karma

latest
Source
npmnpm
Version
1.0.5
Version published
Weekly downloads
75K
-19.34%
Maintainers
1
Weekly downloads
 
Created
Source

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();
    });

});

Keywords

karma

FAQs

Package last updated on 04 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts