Skip to content

Commit 4238f58

Browse files
author
Ben Monro
committed
Merge branch 'master' of github.com:testing-library/svelte-testing-library
2 parents 959c535 + 8c5e369 commit 4238f58

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ Links:
248248
[build]: https://travis-ci.org/testing-library/svelte-testing-library
249249
[coverage-badge]: https://img.shields.io/codecov/c/github/testing-library/svelte-testing-library.svg?style=flat-square
250250
[coverage]: https://codecov.io/github/testing-library/svelte-testing-library
251-
[version-badge]: https://img.shields.io/npm/v/svelte-testing-library.svg?style=flat-square
251+
[version-badge]: https://img.shields.io/npm/v/svlt-testing-library.svg?style=flat-square
252252
[package]: https://www.npmjs.com/package/svelte-testing-library
253253
[downloads-badge]: https://img.shields.io/npm/dm/svelte-testing-library.svg?style=flat-square
254254
[npmtrends]: http://www.npmtrends.com/svelte-testing-library

src/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import {getQueriesForElement, prettyDOM} from 'dom-testing-library'
22

33
export * from 'dom-testing-library'
44
const mountedContainers = new Set()
5-
export const render = (Component, {target = document.createElement('div'), ...options} = {}) => {
6-
document.body.appendChild(target)
5+
export const render = (Component, {target, ...options} = {}) => {
6+
if (!target) {
7+
target = document.body.appendChild(document.createElement('div'))
8+
}
79

810
const component = new Component({
911
...options,

0 commit comments

Comments
 (0)