{"action":"created","issue":{"url":"https://api.github.com/repos/Munter/unexpected-dom/issues/25","labels_url":"https://api.github.com/repos/Munter/unexpected-dom/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/Munter/unexpected-dom/issues/25/comments","events_url":"https://api.github.com/repos/Munter/unexpected-dom/issues/25/events","html_url":"https://github.com/Munter/unexpected-dom/issues/25","id":98420475,"number":25,"title":"Extra assertions","user":{"login":"bruderstein","id":91716,"avatar_url":"https://avatars.githubusercontent.com/u/91716?v=3","gravatar_id":"","url":"https://api.github.com/users/bruderstein","html_url":"https://github.com/bruderstein","followers_url":"https://api.github.com/users/bruderstein/followers","following_url":"https://api.github.com/users/bruderstein/following{/other_user}","gists_url":"https://api.github.com/users/bruderstein/gists{/gist_id}","starred_url":"https://api.github.com/users/bruderstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bruderstein/subscriptions","organizations_url":"https://api.github.com/users/bruderstein/orgs","repos_url":"https://api.github.com/users/bruderstein/repos","events_url":"https://api.github.com/users/bruderstein/events{/privacy}","received_events_url":"https://api.github.com/users/bruderstein/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-31T16:03:24Z","updated_at":"2015-07-31T23:09:37Z","closed_at":"2015-07-31T23:09:37Z","body":"I've been adding a number of tests to a React component (react-select), and come across a couple of things \"missing\" from unexpected-dom, such that I'd sometimes have ... 'queried for', ... in the assertion, and then a similar assertion I'd need  .querySelectorAll(...)\r\n\r\nThe two main cases are:\r\n\r\n1) Checking that something doesn't exist\r\n\r\nFor example:\r\n```\r\nexpect(domNode.querySelectorAll('.something-i-dont-want'), 'to have length', 0)\r\n```\r\n\r\nThis seems analogous to \r\n```\r\nexpect(domNode, 'queried for', '.something-i-do-want', 'to have length', 1)\r\n```\r\n\r\nBut needs to be expected differently.\r\nIt'd be nice if we could do\r\n\r\n```\r\nexpect(domNode, 'to have no elements matching', '.something-i-dont-want')\r\n```\r\n\r\nThe [no] could be optional, making the above test (`.something-i-do-want`) even nicer to read.\r\n\r\n\r\n\r\n2) The second case is more complex, and maybe there's a better way. This is when I want to check for children in a particular order.\r\nI've ended up doing\r\nvar items = domNode.querySelectorAll('.my-selector')\r\nexpect(items[0], 'to have attributes', ... )\r\nexpect(items[1], 'to have attributes', ... )\r\n\r\nThis isn't too bad, but wondered if there was a way to do it without resorting to .querySelectorAll().\r\nI've sometimes been able to use `:nth-child(1)`, but that isn't always a solution when the selector is more complex.\r\n \r\nThink I could probably manage the first point, if you're open to a PR for it?\r\n"},"comment":{"url":"https://api.github.com/repos/Munter/unexpected-dom/issues/comments/126831986","html_url":"https://github.com/Munter/unexpected-dom/issues/25#issuecomment-126831986","issue_url":"https://api.github.com/repos/Munter/unexpected-dom/issues/25","id":126831986,"user":{"login":"bruderstein","id":91716,"avatar_url":"https://avatars.githubusercontent.com/u/91716?v=3","gravatar_id":"","url":"https://api.github.com/users/bruderstein","html_url":"https://github.com/bruderstein","followers_url":"https://api.github.com/users/bruderstein/followers","following_url":"https://api.github.com/users/bruderstein/following{/other_user}","gists_url":"https://api.github.com/users/bruderstein/gists{/gist_id}","starred_url":"https://api.github.com/users/bruderstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bruderstein/subscriptions","organizations_url":"https://api.github.com/users/bruderstein/orgs","repos_url":"https://api.github.com/users/bruderstein/repos","events_url":"https://api.github.com/users/bruderstein/events{/privacy}","received_events_url":"https://api.github.com/users/bruderstein/received_events","type":"User","site_admin":false},"created_at":"2015-07-31T23:09:37Z","updated_at":"2015-07-31T23:09:37Z","body":"It's there. I just set out to add this, and 'to contain no elements matching' is there. I'll maybe send a PR for the readme :)\r\n\r\nThanks again :+1: "}}