Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

karma-better-sinon-chai

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-better-sinon-chai

Maintained Sinon and Chai for Karma

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

NPM version Dependency status devDependency Status

karma-better-sinon-chai

for Karma

Requirements

This Karma plugin requires Karma >=0.10

Installation

Install the module via npm

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

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

module.exports = function(config) {
  config.set({
    frameworks: ['mocha', 'better-sinon-chai'],
    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 :bomb:.

Keywords

FAQs

Package last updated on 25 Jun 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc