Report missing tests for public functions #102
grrinchas
started this conversation in
Rule ideas
Replies: 1 comment
-
I'm less excited by this rule because I rarely have just one test per exposed function. Most of my test modules expose an |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dependent rules:
This rule would not work if rule #101 is not enabled.
What problems does it solve:
I had this problem when you create a module, then write tests for that module, and then you forget about that module. Later you decide to add more functions to that module, but you either forget or are just lazy to add corresponding tests. Therefore, you end up with less test coverage.
Example of things the rule would report:
In the following example we have
User.elm
model which exposes two functionsencode
andtoString
. Then we have correspondingUserTest.elm
module, which has onlytoStringTest
function. The rule would detect thatencodeTest
is missing. It would not have any effect on thedecode
function, cause it is private.Example of things the rule would not report:
When to enable this rule:
This rule is not a replacement for a proper test coverage tool, but it does have one advantage is that it reports only those modules which have already been tested. Therefore you would enable it if
When (not) to enable this rule:
I am looking for:
I have already written this rule and been using for a while. Wondering if I should publish it or not? And if publish, whether under my own name or more official one?
Beta Was this translation helpful? Give feedback.
All reactions