Closed sethmfuller closed 5 months ago
Can you say where the test file is located, relative to the package root? I believe it must be in test/
.
Can you say where the test file is located, relative to the package root? I believe it must be in
test/
.
Yes, @srawlins it is in the test directory. It's in the same relative directory as lib is
I found the issue. It was because I had my tests in the tests/
directory instead of the test/
directory. The code generator won't find the tests if they aren't in the test/
directory. 🤦🏼♂️
I have a simple Dart class that is using the package Dio in one of its methods. In the class's corresponding test file, I'm trying to mock Dio by placing @GenerateMocks([Dio]) above the main method. I then ran dart run build_runner build to generate the mocks for Dio. But no mocks were generated. The command line outputted the following:
Why is it not generating anything?
I tried updating my dependencies thinking that maybe this was the issue but it wasn't.
I've run dart run build_runner build from the root of the project, and I get 0 outputs. I've also run it from the folder where the test is located and that errored out.
I've also tried generating mocks for a different class, but that had the exact same result.
Any ideas for what build_runner isn't generating anything?