Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jakelazaroff/karma-chai-immutable
Chai and Immutable for Karma
https://github.com/jakelazaroff/karma-chai-immutable
Last synced: about 2 months ago
JSON representation
Chai and Immutable for Karma
- Host: GitHub
- URL: https://github.com/jakelazaroff/karma-chai-immutable
- Owner: jakelazaroff
- License: mit
- Created: 2015-12-12T16:25:05.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-07T02:18:59.000Z (over 8 years ago)
- Last Synced: 2024-03-15T00:58:41.109Z (10 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
karma-chai-immutable
==========[![npm](https://img.shields.io/npm/dm/karma-chai-immutable.svg?maxAge=2592000)](https://www.npmjs.com/package/karma-chai-immutable)
Makes the [chai-immutable](https://github.com/astorije/chai-immutable) adapter for [Chai](http://chaijs.com) and [Immutable](https://facebook.github.io/immutable-js/) available in [Karma](http://karma-runner.github.io)
Installation
------------```sh
$ npm install karma-chai-immutable --save-dev
```Add `chai-immutable` to the `frameworks` key in your Karma configuration:
```js
module.exports = function(config) {
'use strict';
config.set({
frameworks: ['mocha', 'chai-immutable'],
#...
});
}
```Usage
-----Chai matchers for Immutable are available in tests:
```js
describe('chai-immutable', function () {it('can compare objects', function () {
var a = Immutable.Map({key: 'value'}),
b = a.merge({key: 'value'}),
c = a.merge({key: 'other value'});a.should.equal(b);
a.should.not.equal(c);
});it('can check if an Immutable is empty', function () {
Immutable.List().should.be.empty;
});
});
```See [chai-immutable](https://github.com/astorije/chai-immutable) for full documentation.
Thanks
------Cheers to [chai-immutable](https://github.com/astorije/chai-immutable) and [karma](https://github.com/karma-runner/karma)!