Open HeronKyaw opened 9 months ago
I created a build.yaml as this but it's not creating a mock directory. I have tried many ways but none of them is working. is it because I need some configuration or plugins? Everything else is working fine. Here's my code:
build.yaml
targets: $default: builders: mockito|mockBuilder: generate_for: - test/**.dart options: build_extensions: '^test/{{}}.dart' : 'test/mocks/{{}}.mocks.dart' builders: mockBuilder: import: "package:mockito/src/builder.dart" builder_factories: ["buildMocks"] build_extensions: {".dart": [".mocks.dart"]} build_to: source auto_apply: dependents defaults: generate_for: ['test/**']
here's my pubspec.yaml -
dev_dependencies: mockito: 5.4.2 build_runner: ^2.4.6
Before generating -
└── test └── example_bloc_test.dart
After generating -
└── test ├── example_bloc_test.dart └── example_bloc_test.mocks.dart
What it is supposed to be -
└── test ├── example_bloc_test.dart └── mock └── example_bloc_test.mocks.dart
Thanks.
Facing the same issue. Trying with the build.yaml provided in the docs.
And having the same folder and file structure as the example given by @HeronKyaw.
I created a
build.yaml
as this but it's not creating a mock directory. I have tried many ways but none of them is working. is it because I need some configuration or plugins? Everything else is working fine. Here's my code:here's my pubspec.yaml -
Before generating -
After generating -
What it is supposed to be -
Thanks.