Skip to content

Commit 5b3e911

Browse files
committed
✅ Add test
1 parent 04aa959 commit 5b3e911

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

packages/command/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test/lib/gen/
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
flutter:
2+
assets:
3+
- assets/
4+
5+
flutter_gen:
6+
assets:
7+
enabled: true
8+
style: snake-case
9+
package_parameter_enabled: true

packages/command/test/flutter_gen_command_test.dart

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'dart:io' show Platform;
22

3+
import 'package:flutter_gen_core/generators/generator_helper.dart' as helper;
34
import 'package:flutter_gen_core/version.gen.dart';
45
import 'package:test/test.dart';
56
import 'package:test_process/test_process.dart';
@@ -52,7 +53,7 @@ void main() {
5253
await process.shouldExit(0);
5354
});
5455

55-
test('Execute wrong argments with fluttergen --wrong', () async {
56+
test('Execute wrong arguments with fluttergen --wrong', () async {
5657
var process = await TestProcess.start(
5758
'dart',
5859
['bin/flutter_gen_command.dart', '--wrong'],
@@ -67,4 +68,20 @@ void main() {
6768
);
6869
await process.shouldExit(0);
6970
});
71+
72+
test('Execute deprecated config with fluttergen', () async {
73+
final process = await TestProcess.start(
74+
'dart',
75+
[
76+
'bin/flutter_gen_command.dart',
77+
'--config',
78+
'test/deprecated_configs.yaml',
79+
],
80+
);
81+
final errors = (await process.stderr.rest.toList()).join('\n');
82+
expect(errors, contains(helper.sWarning));
83+
expect(errors, contains('style'));
84+
expect(errors, contains('package_parameter_enabled'));
85+
await process.shouldExit(0);
86+
});
7087
}

0 commit comments

Comments
 (0)