a simple chai plugin for asserting on types
npm install chai-asserttype---
npm install chai-asserttype
`---
Usage
$3
`
const chai = require('chai');
const asserttype = require('chai-asserttype');
chai.use(asserttype);
`$3
Asserts that type of actual is Number.`
expect(1).to.be.number();
expect(0).to.be.number();
expect(-1).to.be.number();
expect(63465789908753).to.be.number();
expect(27.11).to.be.number();
`$3
Asserts that type of actual is String.`
expect('').to.be.string();
expect('foobar').to.be.string();
`$3
Asserts that type of actual is Boolean.`
expect(true).to.be.boolean();
expect(false).to.be.boolean();
`$3
Asserts that type of actual is Object.`
expect({}).to.be.object();
`$3
Asserts that type of actual is Array.`
expect([]).to.be.array();
expect([1, 2, 3]).to.be.array();
`$3
Asserts that type of actual is date.`
expect(new Date()).to.be.date();
`$3
Asserts that type of actual is Function.`
expect(() => true).to.be.function();
``