nathanboktae / chai-dom

DOM assertions for the Chai assertion library using vanilla JavaScript
Other
76 stars 26 forks source link

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

Open nathanboktae opened 9 years ago

nathanboktae commented 9 years ago

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/])
andipabst commented 6 years ago

Isn't the first already implemented?

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