chai-dom
chai-dom copied to clipboard
Support `text` and `attr` on NodeLists by passing an array
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/])
Isn't the first already implemented?
But I would try to implement the second one, if that's okay to you? :)