test_track_test_support 0.1.4 copy "test_track_test_support: ^0.1.4" to clipboard
test_track_test_support: ^0.1.4 copied to clipboard

Test utilities for working with package:test_track, including a FakeTestTrack allowing you to test your integration with TestTrack with predetermined behavior.

TestTrack Test Support #

This is the testing support package intended to facilitate easy integration testing with the TestTrack dart client.

FakeTestTrack #

The most useful utility offered by this package is FakeTestTrack. This is a TestTrack instance that has the same API as the production implementation, but doesn't talk to your backend. Instead, it supports configuring the desired split configurations so you can test how your application responds.

/// Creates a TestTrack instance where
/// all Abs return true
final testTrack = FakeTestTrack(
    ab: (_, __, ___) => true;
);

/// Creates a TestTrack instance where
/// all Varys return true
final testTrack = FakeTestTrack(
    vary: (_, __, ___) => true;
);

If you don't want to specify how the FakeTestTrack should respond, you can rely on its sane defaults.

Factories #

This package also providers factories for use in tests.

final visitor = VisitorFactory.build().withAssignments(...);
final splitRegistry = SplitRegistryFactory.build();

final testTrack = FakeTestTrack(
    visitor: visitor,
    splitRegistry: splitRegistry,
);
2
likes
140
pub points
17%
popularity

Publisher

verified publisherbetterment.dev

Test utilities for working with package:test_track, including a FakeTestTrack allowing you to test your integration with TestTrack with predetermined behavior.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (LICENSE)

Dependencies

equatable, meta, random_string, test_track

More

Packages that depend on test_track_test_support