-
Notifications
You must be signed in to change notification settings - Fork 13
/
integration_test.dart
55 lines (47 loc) · 1.21 KB
/
integration_test.dart
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
@Timeout.factor(4)
import 'package:build_verify/build_verify.dart' show defaultCommand;
import 'package:build_verify/src/impl.dart';
import 'package:build_verify/src/utils.dart';
import 'package:git/git.dart';
import 'package:test/test.dart';
import 'package:test_descriptor/test_descriptor.dart' as d;
import 'package:test_process/test_process.dart';
void main() {
setUp(() async {
await d.file(
'pubspec.yaml',
'''
name: example
version: 1.2.3
environment:
sdk: '>=2.12.0 <3.0.0'
dev_dependencies:
build_runner: ^2.0.0
build_version: ^2.0.0
''',
).create();
await d.dir('lib', [
d.dir('src', [
d.file(
'version.dart',
r'''
// Generated code. Do not modify.
const packageVersion = '1.2.3';
''',
)
])
]).create();
final gitDir = await GitDir.init(d.sandbox, allowContent: true);
await gitDir.runCommand(['add', '.']);
await gitDir.runCommand(['commit', '-am', 'test']);
final process = await TestProcess.start(
dartPath,
['pub', 'get'],
workingDirectory: d.sandbox,
);
await process.shouldExit(0);
});
test('success unit test', () async {
await expectBuildCleanImpl(d.sandbox, defaultCommand);
});
}