karma-sinon

WebJar for karma-sinon

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

karma-sinon
Last Version

Last Version

1.0.5
Release Date

Release Date

Type

Type

jar
Description

Description

karma-sinon
WebJar for karma-sinon
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/yanoosh/karma-sinon

Download karma-sinon

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/karma-sinon/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>karma-sinon</artifactId>
    <version>1.0.5</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/karma-sinon/
implementation 'org.webjars.npm:karma-sinon:1.0.5'
// https://jarcasting.com/artifacts/org.webjars.npm/karma-sinon/
implementation ("org.webjars.npm:karma-sinon:1.0.5")
'org.webjars.npm:karma-sinon:jar:1.0.5'
<dependency org="org.webjars.npm" name="karma-sinon" rev="1.0.5">
  <artifact name="karma-sinon" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='karma-sinon', version='1.0.5')
)
libraryDependencies += "org.webjars.npm" % "karma-sinon" % "1.0.5"
[org.webjars.npm/karma-sinon "1.0.5"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

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

});

Versions

Version
1.0.5