From 87624c56caf02d6570cf0d0f2141b6738961a822 Mon Sep 17 00:00:00 2001 From: luttje <2738114+luttje@users.noreply.github.com> Date: Sun, 1 Dec 2024 18:58:46 +0100 Subject: [PATCH] improve addon readme --- gmod-addon/README.md | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/gmod-addon/README.md b/gmod-addon/README.md index 63ee43b..4b12ed5 100644 --- a/gmod-addon/README.md +++ b/gmod-addon/README.md @@ -1,9 +1,17 @@ -# Jestronaut - Garry's Mod Addon` +# Jestronaut - Garry's Mod Addon + +This addon provides a way to run Jestronaut tests in Garry's Mod. It includes the Jestronaut library and a reporter for Garry's Mod. + +> [!WARNING] +> The addon has quite a hacky implementation surrounding `require`. +> This is done to make `require` return values from modules it requires. +> +> If you find that this causes issues, feel free to open an issue. ## Installation -1. Download the addon from the latest Jestronaut release from the -[releases page](https://github.com/luttje/jestronaut/releases). +1. Download the addon from the assets of the latest Jestronaut release from the +[releases page](https://github.com/luttje/jestronaut/releases). The file is named `gmod-addon.zip`. 2. Extract the contents of the `gmod-addon.zip` file to your Garry's Mod `addons` folder. @@ -53,8 +61,13 @@ 3. Run the runner script in Garry's Mod: - ``` + ```bash lua_openscript run-all-tests.lua + ``` + + *The output should look like this:* + + ``` Running script run-all-tests.lua... ๐Ÿš€ Starting 2 tests at 17:26:02... @@ -80,3 +93,11 @@ ``` *Note that the emoji icons are displayed as `โ–กโ–ก` in the Garry's Mod console due to insufficient Unicode support.* + +## Testing if Jestronaut is working + +Jestronaut's own tests are included in the addon. To run them in Garry's Mod use the following command: + +```bash +lua_openscript gmod-test.lua +```