Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I configured build.yaml as this repo, but it's not working as I expected #693

Open
HeronKyaw opened this issue Sep 12, 2023 · 1 comment

Comments

@HeronKyaw
Copy link

HeronKyaw commented Sep 12, 2023

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:

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.

@KevalPrajapati
Copy link

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.

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

No branches or pull requests

2 participants