debitoor / chai-subset

"containSubset" object properties matcher for Chai
http://chaijs.com/plugins/chai-subset/
MIT License
82 stars 20 forks source link

Subset with exact array order #65

Open bladeSk opened 6 years ago

bladeSk commented 6 years ago

As the title says. Have you considered adding this functionality? I found myself needing to use it a lot when testing MongoDB outputs and any other structured data, really.

[1, 2, 3].should.containSubsetInOrder([1, 2, 3]];
[1, 2, 3].should.not.containSubsetInOrder([3, 2, 1]];

Here's a fork of your library that implements this: chai-subset-in-order. But why use 2 libraries, when the original one could handle this easily? I could do a PR. Would you consider merging this in?

Related issue https://github.com/debitoor/chai-subset/issues/46

eagleeye commented 6 years ago

@bladeSk yeap, I'll merge it. Don't forget to write some tests