https://github.com/minidigger/minitestframework
Integration Test Framework for Paper!
https://github.com/minidigger/minitestframework
Last synced: 12 days ago
JSON representation
Integration Test Framework for Paper!
- Host: GitHub
- URL: https://github.com/minidigger/minitestframework
- Owner: MiniDigger
- License: mit
- Created: 2021-11-06T19:26:49.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T05:39:29.000Z (about 2 years ago)
- Last Synced: 2025-03-01T21:16:41.649Z (about 1 year ago)
- Language: Java
- Size: 158 KB
- Stars: 20
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MiniTestFramework
Integration Test Framework for Paper!
## Usage
* Install plugin
* Create Test Structure
* `/test create [width]`
* Build contraption
* Save schematic
* Create Test Script
* create .js in plugin folder
* register a new test case into the registry
```js
import {registry, EntityType} from "./minitestframework/index.mjs";
registry.register("test", (helper) => {
helper.pressButton(3, 3, 3);
helper.succeedWhenEntityPresent(EntityType.MINECART, 1, 2, 3);
});
```
* use helper to do actions and assertions (basic auto complete should be provided by the auto generated definition files)
* use `/test pos` ingame to find relation locations
* Reload script changes with `/minitest reload`
* Run test via command block ingame or `/test run*` commands
Example: https://streamable.com/e/k6kngh
## Running in CI
When the plugin detects that the CI env var is set to true, it will automatically run all tests, write a test-results.xml (in junit format) and stop the server.
If exit code > 0, then X number of required tests failed. If exit code < 0, then X number of optional test failed. Exit code = 0 means happy day :)
## Contribution
Best to hit me up on the paper discord: https://discord.gg/papermc
`gradlew runServer` to test locally.
## Licence
MIT