testing library
Test matchers for Result and Option types.
Import this library in your test files to use fluent matchers:
import 'package:light_result/light_result.dart';
import 'package:light_result/testing.dart';
import 'package:test/test.dart';
void main() {
test('returns Success', () {
expect(fetchUser(1), isSuccess);
expect(fetchUser(1), isSuccessWith(expectedUser));
});
}
Constants
Functions
-
isFailureWith(
Object? value) → Matcher -
A matcher that verifies a Result is Failure containing
value. -
isSomeWith(
Object? value) → Matcher -
A matcher that verifies an Option is Some containing
value. -
isSuccessWith(
Object? value) → Matcher -
A matcher that verifies a Result is Success containing
value.