Skip to content

Commit

Permalink
test out tearDown()
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Sep 20, 2023
1 parent c4d7e8f commit f549863
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/patrol/test/callbacks_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,22 @@ void main() {
});

group('groupA', () {
test('testA', () {});
test('testB', () {});
test('testC', () {});
patrolSetUp(() {
print('setting up before $currentTest');
});

tearDown(() {
print('tearing down after $currentTest');
});

test('testA', _body);
test('testB', _body);
test('testC', _body);
});
}

void _body() => print(Invoker.current!.fullCurrentTestName());

void patrolSetUp(dynamic Function() body) {
setUp(() {
final currentTest = Invoker.current!.fullCurrentTestName();
Expand Down

0 comments on commit f549863

Please sign in to comment.