nathanboktae/chai-dom

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

Open

#3 aperta il 30 ott 2015

Vedi su GitHub
 (1 commento) (1 reazione) (0 assegnatari)JavaScript (24 fork)github user discovery
help wanted

Metriche repository

Star
 (77 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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/])

Guida contributor