testClient function
Implementation
@isTest
void testClient(
String description,
FutureOr<void> Function(ClientTester tester) callback, {
String location = '/',
bool? skip,
Timeout? timeout,
Object? tags,
}) {
test(
description,
() async {
if (web.window.location.pathname != location) {
web.window.history.replaceState(null, 'Test', location);
}
final binding = ClientAppBinding();
final tester = ClientTester._(binding);
await binding.runTest(() async {
await callback(tester);
});
// Clear all nodes
web.document.body?.replaceChildren(<web.Node>[].toJS);
},
skip: skip,
timeout: timeout,
tags: tags,
);
}