mocktailx

A set of utility functions for mocktail apis.

Usage

First import mocktailx to your pubspec:

mocktailx: ^0.0.1  

Note that this library is a container for mocktail 0.1.4, so you don't need to import mocktail.
And don't forget to fix your imports:

import 'package:mocktailx/mocktailx.dart';  

Features

thenAnswerWithVoid

// Instead of doing:  
when(repo.futureVoidFunction).thenAnswer((invocation) async {});  
// You can just:  
when(repo.futureVoidFunction).thenAnswerWithVoid();   

thenAnswerWith(T)

// Instead of doing:  
when(repo.futureIntFunction).thenAnswer((invocation) async => 10);  
// You can just:  
when(repo.futureIntFunction).thenAnswerWith(10);  

thenEmit(List)

// Instead of doing:  
when(repo.streamValue).thenAnswer((invocation) => Stream.fromIterable([1,2,3,4,5]));  
// You can just:  
when(repo.streamValue).thenEmit([1,2,3,4,5]);  

Libraries

mocktailx