Skip to content

Commit 9155ef5

Browse files
committed
Explicitly set the variable to null
These variables are set during the tests. But the value a variable is set to carries over to the next test. This doesn't lead to problems in the current set of tests but making the starting conditions of each test crystal clear leads to less surprises.
1 parent d15f308 commit 9155ef5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/logger_test.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ void main() {
3939
printedStackTrace = s;
4040
});
4141

42+
setUp(() {
43+
printedLevel = null;
44+
printedMessage = null;
45+
printedError = null;
46+
printedStackTrace = null;
47+
});
48+
4249
test('Logger.log', () {
4350
Logger logger = Logger(filter: _NeverFilter(), printer: callbackPrinter);
4451
logger.log(Level.debug, "Some message");

0 commit comments

Comments
 (0)