minimal_test library

A minimalist library for writing Dart VM tests. Provides the functions:

  • test, group, setUpAll, and tearDownAll.

Functions

expect(dynamic actual, dynamic expected, {String reason = '', IsMatching? isMatching, num precision = 1e-12}) → void
Compares actual with expected and throws a FailedTestException if the two objects do not match.
group(String description, dynamic body()) FutureOr<void>
Adds the tests contained in body to the current test group.
match(dynamic left, dynamic right, {IsMatching? isMatching, num precision = 1.0e-12}) bool
Returns true if left matches right.
setUpAll(dynamic callback()) FutureOr<void>
Registers a function to be run before each test body.
tearDownAll(dynamic callback()) FutureOr<void>
Registers a function to be run after each tests body.
test(String description, dynamic body()) FutureOr<void>
Performs a test by running the function body.

Typedefs

IsMatching = bool Function(dynamic left, dynamic right)
Type of a callback function used to register a custom matcher with match.

Exceptions / Errors

FailedTestException
Exception used to signal that an expect test has failed.