Skip to content

Commit a926a63

Browse files
Ilya Yanokcopybara-github
authored andcommitted
Add a note on only running codegen on files under test/ by default
Fixes #631 Fixes #550 PiperOrigin-RevId: 544670948
1 parent 9f40189 commit a926a63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ dart run build_runner build
5858
`@GenerateNiceMocks` annotation. In the above `cat.dart` example, we import the
5959
generated library as `cat.mocks.dart`.
6060

61+
**NOTE**: by default only annotations in files under `test/` are processed, if
62+
you want to add Mockito annotations in other places, you will need to add a
63+
`build.yaml` file to your project, see [this SO answer](https://stackoverflow.com/questions/68275811/is-there-a-way-to-let-mockito-generate-mocks-for-integration-tests-in-a-flutter).
64+
6165
The generated mock class, `MockCat`, extends Mockito's Mock class and implements
6266
the Cat class, giving us a class which supports stubbing and verifying.
6367

0 commit comments

Comments
 (0)