runInTestEnvironment<T> static method
Future<T>
runInTestEnvironment<T>(
- Future<
T> test(- ZenTestContainer container
- String? name,
- void setup(
- ZenTestContainer container
Run a test with a clean Zen environment
Implementation
static Future<T> runInTestEnvironment<T>(
Future<T> Function(ZenTestContainer container) test, {
String? name,
void Function(ZenTestContainer container)? setup,
}) async {
final container = createTestEnvironment(name: name, setup: setup);
try {
return await test(container);
} finally {
container.dispose();
}
}