Skip to content

Commit 30ac68a

Browse files
author
Kent C. Dodds
committed
chore(tests): improve tests
1 parent 605b0d7 commit 30ac68a

File tree

6 files changed

+80
-436
lines changed

6 files changed

+80
-436
lines changed

src/__tests__/__snapshots__/wait-for-element.js.snap

Lines changed: 0 additions & 82 deletions
This file was deleted.

src/__tests__/helpers/test-utils.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ function render(html, {container = document.createElement('div')} = {}) {
1010
}
1111

1212
function renderIntoDocument(html) {
13-
document.body.innerHTML = html
14-
const containerQueries = getQueriesForElement(document)
15-
return {container: document, ...containerQueries}
13+
return render(html, {container: document.body})
1614
}
1715

18-
export {render, renderIntoDocument}
16+
function cleanup() {
17+
document.body.innerHTML = ''
18+
}
19+
20+
export {render, renderIntoDocument, cleanup}

0 commit comments

Comments
 (0)