nathanboktae/chai-dom

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

Open

#3 建立於 2015年10月30日

在 GitHub 查看
 (1 留言) (1 反應) (0 負責人)JavaScript (24 fork)github user discovery
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/])

貢獻者指南