configure function Null safety
Configuration for the react-testing-library.
See: testing-library.com/docs/dom-testing-library/api-configuration/
Implementation
void configure({
String? testIdAttribute,
int? asyncUtilTimeout,
bool? computedStyleSupportsPseudoElements,
bool? defaultHidden,
bool? showOriginalStackTrace,
bool? throwSuggestions,
TestingLibraryElementError Function(Object? message, Element container)? getElementError,
}) {
JsError _getJsGetElementError(Object? message, Element container) {
final dartError = allowInterop(getElementError!)(message ?? '', container);
return buildJsGetElementError(dartError.message, container);
}
final existingConfig = getConfig();
return jsConfigure(JsConfig()
..testIdAttribute = testIdAttribute ?? existingConfig.testIdAttribute
..asyncUtilTimeout = asyncUtilTimeout ?? existingConfig.asyncUtilTimeout
..computedStyleSupportsPseudoElements =
computedStyleSupportsPseudoElements ?? existingConfig.computedStyleSupportsPseudoElements
..defaultHidden = defaultHidden ?? existingConfig.defaultHidden
..showOriginalStackTrace = showOriginalStackTrace ?? existingConfig.showOriginalStackTrace
..throwSuggestions = throwSuggestions ?? existingConfig.throwSuggestions
..getElementError = getElementError != null ? allowInterop(_getJsGetElementError) : existingConfig.getElementError);
}