Skip to content

Commit

Permalink
Add information about testing
Browse files Browse the repository at this point in the history
  • Loading branch information
espertus authored Dec 17, 2023
1 parent 9a4f2f9 commit c0ea076
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
For now, these are just some tips:

## Writing tests

Contributions should include unit tests. In general, these should go in [src/test/java/com/spertus/jacquard](https://github.com/espertus/jacquard/tree/main/src/test/java/com/spertus/jacquard). There are a few exceptions...

To test a method that would ordinarily be private, annotate it with the tag `@VisibleForTesting`, make the method package private, and put the test in the same package. [An example will be added soon.]

If you are testing `JUnitTester`, put your test in the ordinary location, but put any tests it runs dynamically in [`src/test/java/com/spertus/jacquard/junittester`](https://github.com/espertus/jacquard/tree/main/src/test/java/com/spertus/jacquard/junittester) or a subdirectory,
tagging the class `"IndirectTest"`. For example, see [`JUnitTesterTest.java`](https://github.com/espertus/jacquard/blob/main/src/test/java/com/spertus/jacquard/JUnitTesterTest.java), which dynamically runs [`SampleTest.java`](https://github.com/espertus/jacquard/tree/main/src/test/java/com/spertus/jacquard/junittester/SampleTest.java).

## Running Tests

The `test/java` sourceset consists mostly of tests that should be directly run; however,
Expand Down

0 comments on commit c0ea076

Please sign in to comment.