Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// './queries' are query functions.
let config = {
testIdAttribute: 'data-testid',
asyncUtilTimeout: 4500,
// this is to support React's async `act` function.
// forcing react-testing-library to wrap all async functions would've been
// a total nightmare (consider wrapping every findBy* query and then also
Expand Down
2 changes: 1 addition & 1 deletion src/wait-for-dom-change.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {getConfig} from './config'

function waitForDomChange({
container = getDocument(),
timeout = 4500,
timeout = getConfig().asyncUtilTimeout,
mutationObserverOptions = {
subtree: true,
childList: true,
Expand Down
2 changes: 1 addition & 1 deletion src/wait-for-element-to-be-removed.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function waitForElementToBeRemoved(
callback,
{
container = getDocument(),
timeout = 4500,
timeout = getConfig().asyncUtilTimeout,
mutationObserverOptions = {
subtree: true,
childList: true,
Expand Down
2 changes: 1 addition & 1 deletion src/wait-for-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function waitForElement(
callback,
{
container = getDocument(),
timeout = 4500,
timeout = getConfig().asyncUtilTimeout,
mutationObserverOptions = {
subtree: true,
childList: true,
Expand Down
2 changes: 1 addition & 1 deletion src/wait.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import waitForExpect from 'wait-for-expect'
import {getConfig} from './config'

function wait(callback = () => {}, {timeout = 4500, interval = 50} = {}) {
function wait(callback = () => {}, {timeout = getConfig().asyncUtilTimeout, interval = 50} = {}) {
return waitForExpect(callback, timeout, interval)
}

Expand Down