Loading...
Loading...
Replace the usage of `expect` and similar functions from `package:matcher` to `package:checks` equivalents.
npx skill4agent add dart-lang/skills dart-migrate-to-checks-packagepubpackage:checksdev_dependencydart pub add dev:checkspackage:matcherpubspec.yamlpackage:testpackage:checks/checks.dartpackage:matcherpackage:checksexpect(actual, equals(expected))expect(actual, expected)check(actual).equals(expected)expect(actual, isA<Type>())check(actual).isA<Type>()expect(actual.property, expected)check(actual).has((a) => a.property, 'property name').equals(expected)..Futureawaitcheckawait check(someFuture).completes((r) => r.equals(expected));StreamStreamQueue.withQueuepubdart pub getdart pub addanalyze_filesrun_testsdart testdart_fixpackage:checkspackage:matcherexpectpackage:checks/checks.dartexpect(...)check(...)analyze_filesrun_testsanalyze_filesisArun_testspackage:checksWhich: has length of <2>check()matcherexpect(someList.length, 1);
expect(someString, startsWith('a'));
expect(someObject, isA<Map>());checkscheck(someList).length.equals(1);
check(someString).startsWith('a');
check(someObject).isA<Map>();matcherexpect('foo,bar,baz', allOf([
contains('foo'),
isNot(startsWith('bar')),
endsWith('baz')
]));checkscheck('foo,bar,baz')
..contains('foo')
..not((s) => s.startsWith('bar'))
..endsWith('baz');matcherexpect(Future.value(10), completion(equals(10)));
expect(Future.error('oh no'), throwsA(equals('oh no')));checksawait check(Future.value(10)).completes((it) => it.equals(10));
await check(Future.error('oh no')).throws<String>().equals('oh no');matchervar stdout = StreamQueue(Stream.fromIterable(['Ready', 'Go']));
await expectLater(stdout, emitsThrough('Ready'));checksvar stdout = StreamQueue(Stream.fromIterable(['Ready', 'Go']));
await check(stdout).emitsThrough((it) => it.equals('Ready'));