Community listing page, reviews here may not be monitored by the author.
Observer
No reviews yet
Unit testing datapack for unit testing datapacks
Community voices
Reviews
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description
Observer
Unit testing for Datapacks.
Overview
Currently this project is in early alpha. It is based on the unit testing functionality from moxlib, although has been moved in to its own project for further love and attention.
The current syntax of Observer is inspired by RSpec.
If you have multiple tests you would like to run at once, place them in functions,
then add those functions to the tag #observer:api/test. Each of the functions must also
call observer:api/perform themselves.
When you run observer:api/start, it will run all the tests at once, and number them.
API
Perform
Checks that the receives tag matches the expects tag.
A test should first run the function needing to be tested, and set the output
of the function into the receives tag.
Note The test suite does not follow the same syntax as the other functions.
Function: observer:api/perform
Storage: observer:test/it
Expects:
describes-- the name of the test, as a stringexpects-- the expected NBT datareceives-- the data received from the function output Returns: The function will tellraw to the executing player the results.
Example:
/function example:return_true
/data modify storage observer:test/it describes set value "always returns true"
/data modify storage observer:test/it expects set value true
/data modify storage observer:test/it receives set from storage example:return_true output
/function observer:api/perform
---
*1 Passed: "always returns true"*
Start
Runs the tests as listed in #observer:api/test.
Function: observer:api/start
Expects: No value expected
Returns: No value returned
Example:
/function observer:api/start
---
*1 Passed: "always returns true"*
*2 Passed: "always returns false"*
*3 Failed: "should returns true"*
- Expected: true
- Received: false
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers