How to achieve test coverage choice 100%? - Has been solved

Hi DAML’ers,
I have solved this “silly” question :face_with_hand_over_mouth:

Thanks all.


Hi DAML’ers
I just finished my very first DAML code. That was very fun!
Now, I need to test my code. I had create a test scenario and run this command :

daml test --show-coverage --all

However, it always returns “test coverage: templates 100%, choices 89%”
So, how to make the coverage choice becomes 100% ?
because I think I have added all of the choices in test scenario.

1 Like

Hi @nr185, well done :grinning:

If you can, would you be able to briefly show how you fixed it? That way others who may happen upon the something similar, can see a potential method to help themselves.

1 Like

Yes, to get 100% test coverage both in template creation and choice execution, we need to ensure

  1. all templates have been created
  2. all choices have been executed both in exerciseCmd and archiveCmd.

Thus, when you run this command :
daml test --show-coverage --all

the result will be :

test coverage: templates 100%, choices 100%
templates never created:
choices never executed:

Yah, that’s all what I did yesterday. Have a great weekend ! :slight_smile:

3 Likes

Thank you for adding that :+1:t2:

2 Likes