Files
react-native-devtools-frontend/node_modules/karma-sinon
Paul Lewis dac9b5e74f Adds karma-sinon to DEPS
R=jacktfranklin@chromium.org
DISABLE_THIRD_PARTY_CHECK=Changes to deps require updating package-lock.json

Change-Id: Ic83355b2d873f0690d4c357bdd42a4833946f594
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2050776
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-02-12 09:54:22 +00:00
..
2020-02-12 09:54:22 +00:00
2020-02-12 09:54:22 +00:00
2020-02-12 09:54:22 +00:00
2020-02-12 09:54:22 +00:00

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

});