You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
consume method receive optional but nullable param initialData.
the problem comes, when useCase input is not nullable.
№2
useCaseTest<ListenAppThemeUseCase, void, AppTheme>(
'WHEN storage emit new value THEN useCase emit it as well',
build: () => useCase,
setUp: () {
controller.add(AppTheme.dark);
controller.close();
},
input: [null],
expect: [useCaseSuccess(AppTheme.dark)],
);
same thing here, but even worse a bit. input can receive a list of values. it might be null (as in the example), but the useCase does not accept nullable values.
So in the current setup error will be swallowed by some internal try/catch (probably line 92, use_case_test.dart) and never returned,
The test continues to execute (transaction never called properly cos of the null value) and as result - timeout exception comes
The text was updated successfully, but these errors were encountered:
So i found 2 bugs in the
use_case
related section, both related to the nullable values:№1
consume
method receive optional but nullable paraminitialData
.the problem comes, when useCase
input
is not nullable.№2
same thing here, but even worse a bit.
input
can receive a list of values. it might be null (as in the example), but the useCase does not accept nullable values.So in the current setup error will be swallowed by some internal try/catch (probably line 92, use_case_test.dart) and never returned,
The test continues to execute (transaction never called properly cos of the null value) and as result - timeout exception comes
The text was updated successfully, but these errors were encountered: