Loading...
Loading...
Replace the usage of `expect` and similar functions from `package:matcher` to `package:checks` equivalents.
npx skill4agent add kevmoo/dash_skills dart-checks-migrationpackage:matcherpackage:checksgrepexpectpackage:matcherdev_dependencieschecksdart pub add --dev checksimport 'package:checks/checks.dart';import 'package:test/test.dart';import 'package:test/scaffolding.dart';expectLegacy | Modern |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
check(() => asyncFunc()).throws<T>()Futureawait check(asyncFunc()).throws<T>();throwsFuture<void>await check(future).throws<Error>().has((e) => e.message, 'message').equals('foo');await check(future).throws<Error>((it) => it.has((e) => e.message, 'message').equals('foo'));isAhavingexpect(() => foo(), throwsA(isA<ArgumentError>()
.having((e) => e.message, 'message', contains('MSG'))));check(() => foo())
.throws<ArgumentError>()
.has((e) => e.message, 'message')
.contains('MSG');expect(obj.prop, equals(value)); // When checking multiple propscheck(obj)
..has((e) => e.prop, 'prop').equals(value)
..has((e) => e.other, 'other').equals(otherValue);voidcheck(it)..isGreaterThan(10)..isLessThan(20);test/pubspec.yamlpackage:checksmatcheras TisA<T>()