Skip to content

ChayimFriedman2/chai-include-ordered-with-gaps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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).

About

A Chai plugin to enable include.ordered.members to work with gaps

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published