-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Error when run very_good test #320
Comments
Hello :) I have two test files where each test file does some preparation work in Minimum reproducible example
import 'package:flutter_test/flutter_test.dart';
import 'package:get_it/get_it.dart';
void main() {
setUp(() {
GetIt.instance.registerFactory<int>(() => 42);
});
tearDown(GetIt.instance.reset);
test('foo', () {
expect(GetIt.instance<int>(), equals(42));
});
}
import 'package:flutter_test/flutter_test.dart';
import 'package:get_it/get_it.dart';
void main() {
setUp(() {
GetIt.instance.registerFactory<int>(() => 123);
});
tearDown(GetIt.instance.reset);
test('bar', () {
expect(GetIt.instance<int>(), equals(123));
});
} Generated // GENERATED CODE - DO NOT MODIFY BY HAND
// Consider adding this file to your .gitignore.
import 'foo_test.dart' as foo_test_dart;
import 'bar_test.dart' as bar_test_dart;
void main() {
foo_test_dart.main();
bar_test_dart.main();
} The tests fail with the exception I suggest the following solution: wrap each test in a Generate the following // GENERATED CODE - DO NOT MODIFY BY HAND
// Consider adding this file to your .gitignore.
import 'package:flutter_test/flutter_test.dart';
import 'foo_test.dart' as foo_test_dart;
import 'bar_test.dart' as bar_test_dart;
void main() {
group('foo_test_dart', foo_test_dart.main);
group('bar_test_dart', bar_test_dart.main);
} |
Description
No error when run flutter test but It's return this exception when Im try run test with very_good cli,
We are using mockito: 5.0.17 on the test case
Steps To Reproduce
Expected Behavior
No error
Additional Context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: