-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhelp_e2e_test.dart
More file actions
58 lines (50 loc) · 1.41 KB
/
help_e2e_test.dart
File metadata and controls
58 lines (50 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@Tags(['e2e'])
library;
import 'package:test/test.dart';
import 'e2e_helpers.dart';
void main() {
late Directory tempDir;
setUp(() {
tempDir = createTestDatasetDir();
});
tearDown(() {
if (tempDir.existsSync()) {
tempDir.deleteSync(recursive: true);
}
});
group('devals --help', () {
test('exits 0 and shows usage', () async {
final result = await runDevals(
['--help'],
workingDirectory: tempDir.path,
);
expect(result.exitCode, 0);
expect(result.stdout, contains('Available commands'));
expect(result.stdout, contains('create'));
expect(result.stdout, contains('doctor'));
expect(result.stdout, contains('init'));
expect(result.stdout, contains('run'));
});
});
group('devals help create', () {
test('exits 0 and shows create subcommands', () async {
final result = await runDevals(
['help', 'create'],
workingDirectory: tempDir.path,
);
expect(result.exitCode, 0);
expect(result.stdout, contains('task'));
expect(result.stdout, contains('job'));
expect(result.stdout, contains('sample'));
});
});
group('devals <invalid command>', () {
test('exits with error for unknown command', () async {
final result = await runDevals(
['nonexistent'],
workingDirectory: tempDir.path,
);
expect(result.exitCode, isNot(0));
});
});
}