Giter VIP home page Giter VIP logo

karma-sinon-chai's Introduction

NPM version Dependency status devDependency Status

karma-sinon-chai

for Karma

Requirements

This Karma plugin requires Karma >=0.10

Installation

Install the module via npm

$ npm install --save-dev karma-sinon-chai

Add sinon-chai to the frameworks key in your Karma configuration:

module.exports = function(config) {
  'use strict';
  config.set({
    frameworks: ['mocha', 'sinon-chai'],

    # chai config
    client: {
      chai: {
        includeStack: true
      }
    }

    #...
  });
}

Usage

Each of the different Chai assertion suites is available in the tests:

describe 'karma tests with chai', ->

  it 'should expose the Chai assert method', ->
    assert.ok('everything', 'everything is ok');

  it 'should expose the Chai expect method', ->
    expect('foo').to.not.equal 'bar'

  it 'should expose the Chai should property', ->
    1.should.not.equal 2
    should.exist 123

Sinon and Chai matchers for Sinon are also available:

describe 'karma tests with sinon', ->

  it 'can spy on objects', ->
    foo = bar: ->
    sinon.spy foo, 'bar'

    foo.bar 'baz'

    foo.bar.should.have.been.calledWith 'baz'

Changelog

v1.1.0

  • Fixed broken Sinon dependency
  • Updated depenencies
    • Chai: ~3.0 => ~3.2.0
    • Sinon: ~1.15.0 => ~1.16.0
  • Removed lodash dependency

v1.0.0

  • Updated to broken sinon version. Probably doesnt work 💣.

karma-sinon-chai's People

Contributors

bitdeli-chef avatar bricss avatar davidbarrows avatar elmariofredo avatar joscha avatar kevicency avatar lordnox avatar marian-r avatar nfroidure avatar nicolasjacquemin avatar princed avatar tarjei avatar vinnymac avatar xdissent avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.