Skip to content

Commit

Permalink
chore: fixed deprecated it() utility
Browse files Browse the repository at this point in the history
  • Loading branch information
tyllark committed Aug 15, 2024
1 parent 2865df0 commit 79b4786
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions actions/test/node/interop_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void main() {

test('exec', () async {
await check(childProcess.exec('echo', ['Hello'])).completes(
it()
(it) => it
..has((res) => res.exitCode, 'exitCode').equals(0)
..has((res) => res.stdout, 'stdout').equals('Hello\n'),
);
Expand All @@ -56,17 +56,17 @@ void main() {
unawaited(
check(proc.stdout!.stream).withQueue.inOrder([
// ignore: unawaited_futures
it()..emits(it()..deepEquals(utf8.encode('Hello\n'))),
(it) => it..emits((it) => it..deepEquals(utf8.encode('Hello\n'))),
// ignore: unawaited_futures
it()..isDone(),
(it) => it..isDone(),
]),
);
unawaited(
check(proc.stderr!.stream).withQueue.isDone(),
);
unawaited(
check((proc.onClose, proc.onExit).wait).completes(
it()..has((res) => res.$2.toDartInt, 'exitCode').equals(0),
(it) => it..has((res) => res.$2.toDartInt, 'exitCode').equals(0),
),
);
await check(proc.onSpawn).completes();
Expand All @@ -82,21 +82,21 @@ void main() {
);
unawaited(
check(proc.stdout!.stream).withQueue.inOrder([
it()
(it) => it
// ignore: unawaited_futures
..emits(
it()..deepEquals(utf8.encode('Hello\n')),
(it) => it..deepEquals(utf8.encode('Hello\n')),
),
// ignore: unawaited_futures
it()..isDone(),
(it) => it..isDone(),
]),
);
unawaited(
check(proc.stderr!.stream).withQueue.isDone(),
);
unawaited(
check((proc.onClose, proc.onExit).wait).completes(
it()..has((res) => res.$2.toDartInt, 'exitCode').equals(0),
(it) => it..has((res) => res.$2.toDartInt, 'exitCode').equals(0),
),
);
await check(proc.onSpawn).completes();
Expand Down
18 changes: 9 additions & 9 deletions actions/test/node/process_manager_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void main() {
group('run', () {
test('echo', () async {
await check(processManager.run(['echo', 'Hello'])).completes(
it()
(it) => it
..has((res) => res.exitCode, 'exitCode').equals(0)
..has((res) => res.stdout, 'stdout').equals('Hello\n'),
);
Expand All @@ -38,7 +38,7 @@ void main() {
test('pipe', () async {
final echo = childProcess.spawn('echo', ['Hello']);
await check(processManager.run(['tee'], pipe: echo)).completes(
it()
(it) => it
..has((res) => res.exitCode, 'exitCode').equals(0)
..has((res) => res.stdout, 'stdout').equals('Hello\n'),
);
Expand All @@ -58,16 +58,16 @@ void main() {
if (mode != ProcessStartMode.inheritStdio &&
mode != ProcessStartMode.detached)
// ignore: unawaited_futures
it()..emits(it()..deepEquals(expectedOutput)),
(it) => it..emits((it) => it..deepEquals(expectedOutput)),
// ignore: unawaited_futures
it()..isDone(),
(it) => it..isDone(),
]),
);
unawaited(
check(proc.stderr).withQueue.isDone(),
);
check(proc.pid).isGreaterThan(0);
await check(proc.exitCode).completes(it()..equals(0));
await check(proc.exitCode).completes((it) => it..equals(0));
});
}

Expand All @@ -76,15 +76,15 @@ void main() {
final proc = await processManager.start(['tee'], pipe: echo);
unawaited(
check(proc.stdout).withQueue.inOrder([
it()
(it) => it
// ignore: unawaited_futures
..emits(it()..deepEquals(utf8.encode('Hello\n'))),
..emits((it) => it..deepEquals(utf8.encode('Hello\n'))),
// ignore: unawaited_futures
it()..isDone(),
(it) => it..isDone(),
]),
);
unawaited(check(proc.stderr).withQueue.isDone());
await check(proc.exitCode).completes(it()..equals(0));
await check(proc.exitCode).completes((it) => it..equals(0));
});
});
});
Expand Down

0 comments on commit 79b4786

Please sign in to comment.