New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

karma-sinon-chai-raynode

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-sinon-chai-raynode

Sinon and Chai for Karma

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

karma-sinon-chai

  • Sinon
  • Chai
  • Sinon-Chai

for Karma

Requirements

This module currently requires the canary version of Karma:

$ npm install 'karma@canary' --save-dev

Note that the Karma configuration file format has changed since v0.8. Use karma init to generate a fresh config.

Grunt

When using grunt-karma to run Karma, you need to use a version >= 0.5.0 because earlier versions of grunt-karma use karma < 0.9 which does not support custom plugins. At the time of this writing, grunt-karma >= 0.5 is not yet available on npm, so you have to install it directly from the git repo, i.e.

npm install --save-dev git+https://github.com/karma-runner/grunt-karma.git

Installation

Install the module from Github:

$ npm install 'git+https://github.com/xdissent/karma-chai.git' --save-dev

Add chai to the frameworks key in your Karma configuration:

module.exports = (karma) ->
  karma.configure

    # frameworks to use
    frameworks: ['mocha', 'chai']

    # ...

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'

Keywords

FAQs

Package last updated on 07 Oct 2013

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