Annotation
Welltested uses annotations to mark the methods in your code to be tested. You can mark classes, extensions or top-level functions.
@Welltested()
@Welltested()
You can mark the methods inside a class or an extension to be tested by adding @Welltested()
annotation to the parent class/extension.
In the above example, we will generate unit tests for logInUser
and logOutUser
methods of Auth
class.
Annotating Top Level Functions:
If you've top-level functions in your code that do not belong to a class or extension method, you can annotate them directly.
Testcases
Our testing AI examines and self creates smart exhaustive test cases for each function based on its use case and contextual code. However, you can specify your own custom test cases for a method by adding @Testcases()
annotation to them.
Exclude Methods
By default, all methods in an annotated class are included. To exclude any method from testing, add their name to the excludedMethods
list in the Welltested
annotation.
In the above case, we will not create unit tests for logOutUser
.
Last updated