Skip to content

BigBlueHat/karma-sinon-chrome

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

karma-sinon-chrome

A Karma plugin - adapter for sinon chrome

describe("sinon chrome", function() {
    beforeEach(function() {
        chrome.reset();
    });

    it("can triger an event", function() {
        chrome.browserAction.onClicked.addListener(function() {
            chrome.tabs.create({ url: "http://sinonjs.org/" });
        });
        chrome.browserAction.onClicked.trigger();
        assert(chrome.tabs.create.calledWith({ url: "http://sinonjs.org/" }));
    });
});

Installation

$ npm i --save-dev karma-sinon-chrome

Add sinon-chrome to the frameworks key in your Karma configuration

module.exports = function(config) {
    config.set({
        //...

        frameworks: ['mocha', 'chai', 'sinon-chrome']

        //...
    });
};

License

MIT

About

A Karma plugin - adapter for sinon-chrome

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%