Skip to content

Commit 57dd63d

Browse files
alexkrolickKent C. Dodds
authored and
Kent C. Dodds
committed
feat(render): expose option to override bound queries (testing-library#177)
* New: expose option to override bound queries * remove unecessary default dom-testing-library will default the queries for us: https://github.com/kentcdodds/dom-testing-library/blob/cbbda90762f9b5c97471841b0d00f05ddfe772ba/src/get-queries-for-element.js#L12
1 parent 595abe6 commit 57dd63d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

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

55
const mountedContainers = new Set()
66

7-
function render(ui, {container, baseElement = container} = {}) {
7+
function render(ui, {container, baseElement = container, queries} = {}) {
88
if (!container) {
99
// default to document.body instead of documentElement to avoid output of potentially-large
1010
// head elements (such as JSS style blocks) in debug output
@@ -29,7 +29,7 @@ function render(ui, {container, baseElement = container} = {}) {
2929
// Intentionally do not return anything to avoid unnecessarily complicating the API.
3030
// folks can use all the same utilities we return in the first place that are bound to the container
3131
},
32-
...getQueriesForElement(baseElement),
32+
...getQueriesForElement(baseElement, queries),
3333
}
3434
}
3535

0 commit comments

Comments
 (0)