chai-include-ordered-with-gaps
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

chai-include-ordered-with-gaps

A Chai plugin to solve Issue #1506: How can I test for an ordered subset with gaps between the elements?.

Installing

npm install --save-dev chai-include-ordered-with-gaps

Using

const chai = require('chai');
const { expect, should, assert } = chai;
 
should();
chai.use(require('chai-include-ordered-with-gaps'));
 
expect([1, 2, 3, 4, 5]).to.include.ordered.members.with.gaps([2, 4, 5]);
 
[1, 2, 3, 4, 5].should.include.ordered.members.with.gaps([2, 4, 5]);
 
assert.includeOrderedMembersWithGaps([1, 2, 3, 4, 5], [3, 4, 5]);

Works with TypeScript too (inline declarations, no need to install a @types package).

Package Sidebar

Install

npm i chai-include-ordered-with-gaps

Weekly Downloads

25

Version

1.0.0

License

MIT

Unpacked Size

8.04 kB

Total Files

7

Last publish

Collaborators

  • chayimfr