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: over 1 year ago
JSON representation
A basic JUnit 5 testing harness for Minecraft Forge mods
- Host: GitHub
- URL: https://github.com/Daomephsta/Saddle
- Owner: Daomephsta
- License: mit
- Created: 2019-10-21T00:01:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-26T08:21:53.000Z (over 5 years ago)
- Last Synced: 2025-03-05T04:18:41.898Z (over 1 year ago)
- Topics: junit5, minecraft-forge, minecraft-forge-mod, minecraft-mod
- Language: Java
- Size: 68.4 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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.