Is there a way in sinon-chai to test whether a string contains sub-strings in the specified order? Something like:
expect("Hello World, it's a lovely day!").to.contain.in.order("World", "day")
Similar to what the sinon-chai-in-order does for spy calls.
I am currently using a regexp matching similar to this:
expect(vm.$el.querySelector('table').textContent.replace(/\r?\n|\r/g, ''))
.to.match(/.*A.*B.*D.*C.*/)
Originally, I was doing the following, but for I am not sure why it doesn't match across the newline:
expect(vm.$el.querySelector('table').textContent)
.to.match(/.*A.*B.*D.*C.*/gm)
However these matches can be sometimes hard to read and readability is the reason I am using sinon-chai.