Closed Mo0Khaled closed 1 year ago
I solve it...
the problem was with the data I put on put expectedJsonArticles on the test file and the data on the production file
mockHiveBox.put(articles, expectedJsonArticles)
box.put(LocaleDbKeys.articleBox, jsonEncode(parsedArticles['articles']));
is not the same
but the error message tells me that I didn't stub this!
@felangel could you help us improve this error message or could you explain if it makes sense to see this error message
just create stub like this when(() => mockLocalDataSource.cacheData()).thenAnswer((_) async => Future.value()); hope this can help
I solve it...
the problem was with the data I put on put expectedJsonArticles on the test file and the data on the production file
mockHiveBox.put(articles, expectedJsonArticles)
box.put(LocaleDbKeys.articleBox, jsonEncode(parsedArticles['articles']));
is not the same
but the error message tells me that I didn't stub this!
@felangel could you help us improve this error message or could you explain if it makes sense to see this error message
Glad you were able to solve this. It looks like this is working as expected but if you have suggestions for how to improve the error message let me know. We can try adding more info like if you have stubbed the method be sure to verify the stubbed arguments match the real arguments? Not sure if that would make it more clear.
i am trying to test cash articles with HIVE package put it throws a type 'Null' is not a subtype >of type 'Future
I stubed it but I don't know why
and the print shows that it's Future
but still shows that is null not Future
test:
function: