nathanboktae/chai-dom
在 GitHub 查看Support `text` and `attr` on NodeLists by passing an array
Open
#3 建立於 2015年10月30日
help wanted
倉庫指標
- Star
- (77 star)
- PR 合併指標
- (PR 指標待抓取)
描述
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/])