# ๐Ÿ•ต๏ธ Debug Tools Debugging is a fundamental aspect of software development. Bookshelf provides tools to help identify and resolve issues effectively. --- ## ๐Ÿงช Unit Tests Tests are essential for ensuring code correctness and preventing future bugs. This project uses Misode's Minecraft Fabric mod, [PackTest](https://github.com/misode/packtest), for testing. ### โš™๏ธ Running Tests To run the tests, you have two options: 1. **Headless Mode**: We provide a simple command `uv run modules test` that allows you to run the tests headlessly, without having to open the game 2. **In-Game**: Download and install the Minecraft Fabric mod. Once that's done, you can run the tests using the test command in Minecraft ```{admonition} Java Required :class: warning Ensure that Java is installed on your system, as it is required for the command to work. ``` ### โœ๏ธ Writing Tests Each test is a `.mcfunction` file inside the `test` folder. When writing tests, make sure to clearly define what you are testing and what the expected outcome is. It's also a good idea to include edge cases to ensure your code can handle all possible inputs. ### ๐Ÿ› ๏ธ Custom Commands PackTest offers a variety of commands to control test flow, validate conditions, and interact with Minecraft's environment: **Test Flow Commands**: - `fail []`: Immediately fails the current test and logs an optional message - `succeed`: Immediately passes the current test - `assert `: Fails the test if the condition is false - `assert not `: Fails the test if the condition is true - `await `: Continuously checks a condition until it succeeds or times out - `await not `: Waits until the condition becomes false - `await delay