Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/daomephsta/saddle

A basic JUnit 5 testing harness for Minecraft Forge mods
https://github.com/daomephsta/saddle

junit5 minecraft-forge minecraft-forge-mod minecraft-mod

Last synced: 16 days ago
JSON representation

A basic JUnit 5 testing harness for Minecraft Forge mods

Awesome Lists containing this project

README

        

# Saddle
A simple test harness for running JUnit 5's Jupiter engine inside Minecraft. It only works with Minecraft Forge at this time.

### Installing Saddle
Saddle is not available on any maven. You should download one of the [precompiled releases](https://github.com/Daomephsta/Saddle/releases), compile Saddle yourself, or use [JitPack](https://jitpack.io/). Saddle should be added to Gradle's `testImplementation` configuration.

### Creating Saddle Tests
Saddle tests are created in exactly the same way as Jupiter tests, with the exception that they must be annotated with `io.github.daomephsta.saddle.engine.SaddleTest` instead of `org.junit.jupiter.api.Test`. All other Jupiter annotations work as normal.

### Configuring Test Discovery
Before you can run Saddle, you must configure which packages/classes should be included/excluded from test discovery.
Saddle is configured by creating a file at the root of your test resources directory named `saddle-config.json`. The format
is as follows.
```
=
{
"pre_init": , //Optional
"init": , //Optional
"post_init": //Optional
}

=
{
"include": , //Optional
"exclude": //Optional
}

=
[
,
...
]

={"package": "foo.bar"} || {"class": "foo.bar.Baz"}

=
[
,
...
]

={"package": "foo.bar"} || {"class": "foo.bar.Baz"}
```

### Running Saddle Tests
Run your mod as usual. Saddle will discover and run Saddle tests according to its configuration.
If you want to disable Saddle without uninstalling it, add `-Dsaddle.disable=true` to your VM arguments.