Loading topic
Intermediate · Mid: 13 chapters · 24 min read. States assumed prerequisites
Start readingFuture, and basic Flutter tests with flutter_test. You should also understand dependency injection, which means passing a class's collaborators into its constructor instead of creating them inside the class.Future, basic tests, and Flutter's testWidgets workflow. This chapter focuses on dependency injection, which is the design step that makes mocking possible.Future, and basic flutter_test tests. You should also be comfortable passing a dependency through a constructor.Future, and basic flutter_test tests. It also assumes you have added mocktail and created a mock class. A stub is a rule that tells a mock what to return when a method is called.Future, Stream, async and await, and basic flutter_test tests. It also assumes you can pass a repository into a class through its constructor.Future, flutter_test, constructor-based dependency injection, and how to create a mocktail mock. The previous chapter introduced stubbing. Here, you will check whether the code under test called its dependency correctly.Future, async and await, and basic flutter_test tests. You should also know how to pass a dependency through a constructor and how to create a Mock class with mocktail.Future, setUp, expect, and basic mocktail stubbing. You will learn how to inspect the exact values that production code sends to a mocked dependency.Future, Stream, flutter_test, and constructor-based dependency injection. It also assumes that you have created mocktail mocks and can stub methods with when.Future, async and await, basic Flutter widgets, and the testWidgets and WidgetTester APIs.Future, Stream, flutter_test, widget tests, and constructor-based dependency injection. This chapter focuses on choosing a test double. A test double is an object that replaces a real dependency during a test.Future, Stream, flutter_test, constructor injection, and the basic mocktail flow of creating a mock, stubbing a call, and verifying an interaction. This chapter focuses on failures that often look mysterious but usually point to one specific problem.