Add a git dependency on this package:
dev_dependencies: checks: git: url: firstname.lastname@example.org:dart-lang/test.git path: pkgs/checks # Omit to try the latest, or pin to a commit to avoid # breaking changes while the library is experimental. ref: <sha>
Add an import to
Replace the existing
package:test/test.dart import with
For an incremental migration within the test, add an import to
package:test/expect.dart. Remove it to surface errors in tests that still need to be migrated, or keep it in so the tests work without being fully migrated.
Migrate the test cases.
Replace calls to
expect with a call to
checkThat passing the first argument. When a direct replacement is available, change the second argument from calling a function returning a Matcher, to calling the extension method on the
When a non-matcher argument is used for the expected value, it would have been wrapped with
equals automatically. See below,
.equals may not always be the correct replacement in
expect(actual, expected); checkThat(actual).equals(expected); // or maybe checkThat(actual).deepEquals(expected);
equalsMatcher performed a deep equality check on collections.
.equals()check will only correspond to [operator ==] so some tests may need to replace
.deepEquals(). TODO: implement