Skip to content

Conversation

@gabrielbmoro
Copy link
Contributor

@gabrielbmoro gabrielbmoro commented Sep 20, 2025

  • Unit tests for get_book_details;
  • Unit tests for search_books;
  • Add di.config.dart to gitignore file;
  • Organize our test directory keep it the same way we organize the code.

@gabrielbmoro gabrielbmoro changed the title Unit tests + Get Book Details Unit tests for Get Book Details Sep 20, 2025
@gabrielbmoro gabrielbmoro changed the title Unit tests for Get Book Details Some Unit tests Sep 20, 2025
@@ -0,0 +1,10 @@
import 'package:mibook/layers/domain/models/book_list_domain.dart';

final fakeBookDomain = BookDomain(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For one moment I was wondering what the hell is a FacebookDomain....

import 'get_book_details_test.mocks.dart';

void main() {
late MockISearchRepository mockSearchRepository;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we avoid late variables in the tests? That could provoke crashes in our CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t understand why this would cause any issues in our CI/CD pipeline, since we’re initializing them properly in the setUp method.

Anyways, I will merge the PR. If you think it is important to address this in the future, let's create an issue in our repo.

🤗

import 'search_books_test.mocks.dart';

void main() {
late MockISearchRepository mockSearchRepository;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@gabrielbmoro gabrielbmoro merged commit 79371b6 into main Sep 26, 2025
1 check passed
@gabrielbmoro gabrielbmoro deleted the feature/unit-tests-impro branch September 26, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants