When testing code that is modified by Pub transformers, pub run test needs to be run with the --pub-serve option. See: https://github.com/dart-lang/test#testing-with-barback.
Right now, there's not a way to pass in that flag.
What would be really awesome is if --pub-serve support was be integrated, and dart_dev also spun up a Pub server automatically before running the tests.
The test package has a utility it uses in its tests that could probably be leveraged as a starting point.
That's a little more involved, though...