{"repo":"misode/packtest","free":true,"listed":false,"github":"https://github.com/misode/packtest","clone":"git clone https://github.com/misode/packtest.git","description":"Fabric mod for testing data packs, with data packs","language":"Java","stars":32,"topics":["data-pack","data-packs","datapack","datapacks","fabricmc","gametest","gametest-minecraft","minecraft","unit-testing"],"license":"MIT","category":"game-templates","readme_excerpt":"PackTest PackTest allows you to write game tests in a data pack. Tests are .mcfunction files in a test folder. They can be used to test custom data packs. Example data/example/test/foo.mcfunction Async tests Test functions can be asynchronous, using the await keyword! Running tests Tests can be run in-game using the test command. Some example commands: test run : : runs all the tests test run : : runs all tests from a specified namespace test run : runs the test with a specified name test runfailed : runs all the previously failed tests test runthis : runs the closes test test runthese : runs all tests within 200 blocks Auto test server Tests can also be run automatically, for instance in a CI environment. When -Dpacktest.auto is set, the game test server will start automatically with the loaded tests. The process will exit when all tests have finished with the exist code set to the number of failed tests. Setting -Dpacktest.auto.annotations will emit GitHub annotations for all test failures and resource load errors. The following example can be adapted into a GitHub action workflow. Commands fail fail : fails the current test and returns from the function succeed succeed : always succeeds the current test and returns from the function assert assert : if condition is unsuccessful, fails the current test and returns from the function assert not : if condition is successful, fails the current test and returns from the function await await : similar to assert, but keeps trying t","default_branch":null,"files":null,"tree":[],"storefront":"/r/misode","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/misode/packtest/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}