Skip to content

Commit

Permalink
A bit of documentation for 'queried for' assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
Munter committed Apr 24, 2015
1 parent ce5176a commit ce0c8e6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@ expect(node, 'to [only] have attributes', {

**Queried for**

Queries the supplied node the designated [querySelector]() and returns a [NodeList](). NodeList is an [array-like]() type, giving you array assertions as an added bonus.

This assertion is primarily useful for chaining.

```js
expect(node, 'queried for [first]', '.blog-article > h2');

// Chaining
expect(node, 'queried for', '.blog-article', 'to have items satisfying', 'to have attributes', {
id: /^article-heading-\d+$/,
'aria-describe': 'Article'
});
```

**When parsed as HTML**

Parses the subject (string) as an HTML document using the facilities available in the browser, with a fallback to jsdom, then delegates to the next assertion in the argument list:
Expand Down

0 comments on commit ce0c8e6

Please sign in to comment.