# karma-sinon-chai

> Sinon and Chai for Karma

Latest version **2.0.2** (published 2018-07-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install karma-sinon-chai
pnpm add karma-sinon-chai
yarn add karma-sinon-chai
bun add karma-sinon-chai
```

## Health

**Score 18/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2018-07-06 |
| First published | 2013-08-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/karma-sinon-chai) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 85 |
| Author | Kevin Mees |
| Maintainers | adambrunner, kmees |
| Keywords | karma, chai, sinon, mocha, should |

## Links

- npm: https://www.npmjs.com/package/karma-sinon-chai
- Repository: https://github.com/kmees/karma-sinon-chai
- Issues: https://github.com/kmees/karma-sinon-chai/issues
- npm.io page: https://npm.io/package/karma-sinon-chai

## Recent versions

- 2.0.2 (latest) — 2018-07-06
- 2.0.1 — 2018-07-06
- 2.0.0 — 2018-07-06
- 1.3.4 — 2018-04-11
- 1.3.3 — 2017-10-27
- 1.3.2 — 2017-08-30
- 1.3.1 — 2017-04-06
- 1.3.0 — 2017-04-06
- 1.2.4 — 2016-09-12
- 1.2.3 — 2016-07-13
- 1.2.2 — 2016-06-30
- 1.2.1 — 2016-06-30
- 1.2.0 — 2016-02-19
- 1.2.0-rc1 — 2016-02-16
- 1.1.0 — 2015-09-14
- … 13 more at https://npm.io/package/karma-sinon-chai/versions

## README

[![NPM version](https://badge.fury.io/js/karma-sinon-chai.png)](http://badge.fury.io/js/karma-sinon-chai) [![Dependency status](https://david-dm.org/xdissent/karma-chai.png)](https://david-dm.org/kmees/karma-sinon-chai) [![devDependency Status](https://david-dm.org/xdissent/karma-chai/dev-status.png)](https://david-dm.org/kmees/karma-sinon-chai#info=devDependencies)

karma-sinon-chai
================

  * [Sinon](http://sinonjs.org/)
  * [Chai](http://chaijs.com)
  * [Sinon-Chai](https://github.com/domenic/sinon-chai)

for [Karma](http://karma-runner.github.io)

Requirements
------------

This Karma plugin requires Karma `>=0.10`

Installation
------------

Install the module via npm

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

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

```js
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:

```coffee
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:

```coffee
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
----------------
### v2.0.0
  * Removed `lolex` dependency. Please use [Sinon's fake timers](http://sinonjs.org/releases/v4.5.0/fake-timers/) instead, which use `lolex` under the hood.

### 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:.

---
_Source: https://npm.io/package/karma-sinon-chai · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
