forked from eatvio/eatvio_app
refactor(tests): replace 'final' with 'const' for improved performance in various test files
This commit is contained in:
@@ -11,7 +11,7 @@ class TestCubit extends BaseCubit<String> {
|
||||
|
||||
Future<String?> executeOperation() async {
|
||||
return await safeExecute(() async {
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
await Future.delayed(const Duration(milliseconds: 10));
|
||||
return 'success';
|
||||
});
|
||||
}
|
||||
@@ -19,7 +19,7 @@ class TestCubit extends BaseCubit<String> {
|
||||
Future<String?> executeOperationWithState() async {
|
||||
return await safeExecuteWithState(
|
||||
() async {
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
await Future.delayed(const Duration(milliseconds: 10));
|
||||
return 'result';
|
||||
},
|
||||
loadingState: 'loading',
|
||||
|
||||
@@ -49,7 +49,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('getErrorMessage extracts error message from error state', () {
|
||||
final errorState = 'error: Something went wrong';
|
||||
const errorState = 'error: Something went wrong';
|
||||
final message = StateUtils.getErrorMessage(errorState);
|
||||
expect(message, isNotNull);
|
||||
expect(message, contains('Something'));
|
||||
|
||||
Reference in New Issue
Block a user