<commit_before>## junit

Executes junit tests and fails if any of the test fail.

 | Name | Type | Default | Description |
 | ---- | ---- | ------- | ----------- |
 | tests | Blob |   | Jar file containing test classes. |
 | deps | [Blob] |   | Array of jars containing junit implementation and other dependencies needed to run tests. |
 | include | String | "**/*Test.class" | Pattern matching java class files from which tests should be run. Works the same way as 'include' param in [filter](filter.md) function. |

Returns __String__ equal to 'SUCCESS'.

### examples

Takes all files from "src" directory, compiles them and executes all tests
among them.
Note that in current releases there's no need to pass jar with junit classes.
Junit binaries are embedded inside smooth-all.jar.
This will probably change in future so it would be easy to update junit
 library without updating smooth version.

```
testJar = files("//src") | javac | jar;
test = [ testJar ]  | junit;
```

Takes all files from "src" directory, compiles them and executes only tests from classes which names end with 'Test'.

```
testJar = files("//src") | javac | jar;
test = [ testJar ]  | junit(include="**/*Test.class");
```<commit_msg>update documentation for junit function in junit.md<commit_after>## junit

Executes junit tests and fails if any of the test fail.

 | Name | Type | Default | Description |
 | ---- | ---- | ------- | ----------- |
 | tests | Blob |   | Jar file containing test classes. |
 | deps | [Blob] |   | Array of jars containing junit implementation and other dependencies needed to run tests. |
 | include | String | "**/*Test.class" | Pattern matching java class files from which tests should be run. Works the same way as 'include' param in [filter](filter.md) function. |

Returns __String__ equal to 'SUCCESS'.

### examples

Takes all files from "src" directory, compiles them and executes all tests
among them.

```
testJar = files("//src") | javac | jar;
test = [ testJar ]  | junit;
```

Takes all files from "src" directory, compiles them and executes only tests from `org.smoothbuild` package and its subpackages recursively which class name ends with `Test`.

```
testJar = files("//src") | javac | jar;
test = [ testJar ]  | junit(include="org/smoothbuild/**/*Test.class");
```
{'fraction_non_alphanumeric': 0.13159041394335513, 'fraction_numerical': 0.0, 'mean_word_length': 3.484375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7413463', 'n_tokens_mistral': 670, 'n_tokens_neox': 637, 'n_words': 283}