VeryGoodOpenSource/very_good_analysis

code coverage

Closed this issue · 2 comments

image

why line 15 not coverage ?? its from docs and yet failed to pass code coverage

Hi @tonyhart7 👋
Thanks for opening an issue!

I'm guessing it's because you are never instantiating an instance of AuthenticationState without a const constructor. When you create an instance with the const constructor it is instantiated too early for test coverage to pick it up. You should be able to cover that line with a test like:

test('...', () {
  expect(AuthenticationState.unauthenticated(), returnsNormally); // make sure not to use `const` 
});

Let me know if that helps 👍

instantiated problem