blob: 527366015f5ca81e9fbeb232b31317ebe91d0f72 [file] [log] [blame]
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_test/flutter_test.dart';
import 'package:go_router/src/logging.dart';
import 'package:logging/logging.dart';
void main() {
// Reset the logger before each test.
setUp(() {
setLogging();
});
test('setLogging enables log messages on the logger', () {
log.onRecord.listen(expectAsync1<void, LogRecord>((LogRecord r) {}));
setLogging(enabled: true);
log.info('message');
});
test('setLogging disables log messages on the logger', () {
log.onRecord
.listen(expectAsync1<void, LogRecord>((LogRecord r) {}, count: 0));
setLogging();
log.info('message');
});
}