Dropsource / monarch

Monarch is a tool for building Flutter widgets in isolation. It makes it easy to build, test and debug complex UIs.
https://monarchapp.io
MIT License
437 stars 22 forks source link

Broken mockito generation after monarch init #41

Closed cerealexx closed 2 years ago

cerealexx commented 2 years ago

Monarch init removes all my .mocks files and breaks code generation for them afterwards. Any ideas on how to fix this?

fertrig commented 2 years ago

Please make sure to add the directory of your .mocks files in your build.yaml. If you are using mockito, then the directory is usually test.

Here is an example build.yaml which supports the monarch directories and the test directory:

targets:
  $default:
    sources:
      - $package$
      - lib/**
      - stories/**
      - test/**

The code generation will now include the test directory, so after you run flutter pub run build_runner build all the .mocks files in the test directory should show up.