Chai Counting
Chai アサーションライブラリの単純なカウントプラグイン。 expect(n).to.be.zero
、expect(n).to.be.one
、以降 expect(n).to.be.ten
まで利用可能。別として、n.should.be.zero
、n.should.be.one
等。これにより、n.should.be.eq(0);
という括弧を打つ負担が省けます。
インストール
npm install chai-counting
使用
const chai = require('chai');
const chaiCounting = require('chai-counting');
chai.use(chaiCounting);