chai-immutable plugin
suggest change- Install from npm chai, chai-immutable, and ts-node
npm install --save-dev chai chai-immutable ts-node
- Install types for mocha and chai
npm install --save-dev @types/mocha @types/chai
- Write simple test file:
import {List, Set} from 'immutable';
import * as chai from 'chai';
import * as chaiImmutable from 'chai-immutable';
chai.use(chaiImmutable);
describe('chai immutable example', () => {
it('example', () => {
expect(Set.of(1,2,3)).to.not.be.empty;
expect(Set.of(1,2,3)).to.include(2);
expect(Set.of(1,2,3)).to.include(5);
})
})
- Run it in the console:
mocha --compilers ts:ts-node/register,tsx:ts-node/register 'test/**/*.spec.@(ts|tsx)'
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents