Skip to content

Commit

Permalink
feature: tests for logger
Browse files Browse the repository at this point in the history
  • Loading branch information
jsilverdev committed Sep 4, 2023
1 parent df497ee commit 9727e9e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning].

- /

## [1.1.0-rc1] - 2023-09-04

### Added

- Test for logger instance


## [1.0.0] - 2023-09-04

### Changed
Expand Down
1 change: 0 additions & 1 deletion lib/config/logger.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// coverage:ignore-file
import 'dart:io';

import 'package:logger/logger.dart';
Expand Down
33 changes: 33 additions & 0 deletions test/config/logger_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import 'dart:io';

import 'package:config_props_extractor/config/logger.dart';
import 'package:mocktail/mocktail.dart';
import 'package:test/test.dart';

class MockStdout extends Mock implements Stdout {}

void main() {

late MockStdout mockStdout;

setUp(() {
mockStdout = MockStdout();
});

test('Should Instance logger', () async {

when(() => mockStdout.hasTerminal)
.thenReturn(true);
when(() => mockStdout.supportsAnsiEscapes)
.thenReturn(true);
when(() => mockStdout.terminalColumns)
.thenReturn(100);

final logger = IOOverrides.runZoned(
() => log,
stdout: () => mockStdout,
);

expect(logger, isNotNull);
});
}

0 comments on commit 9727e9e

Please sign in to comment.