chai-dom icon indicating copy to clipboard operation
chai-dom copied to clipboard

Support `text` and `attr` on NodeLists by passing an array

Open nathanboktae opened this issue 8 years ago • 1 comments

For example

document.querySelectorAll('li').should.have.text(['red', 'blue', 'green'])
document.querySelectorAll('li').should.have.attr('aria-selected', ['', 'true', ''])

Having regex in there too would be nice, maybe something like the following?

document.querySelectorAll('.email').should.have.text(/[^@]+@.+/)
document.querySelectorAll('p').should.have.text([/^Welcome, .+\./, /^For the first step/])

nathanboktae avatar Oct 30 '15 17:10 nathanboktae

Isn't the first already implemented?

But I would try to implement the second one, if that's okay to you? :)

andipabst avatar Jul 19 '18 18:07 andipabst