GLuaTest
🎉 The missing test framework for GMod 🎉
GLuaTest is a testing framework built for Garry's Mod.
Its job is to make writing automated tests for Garry's Mod projects easy and tolerable.
It offers an approachable and flexible syntax that makes writing tests intuitive.
GLuaTest takes a lot of inspiration from both Ruby's RSpec and JavaScript's Jest
Glossary

(Are you an impatient software developer? Check out the quickstart guide to go fast)
(Is the idea of testing your code new to you? That's great! Check out the guided testing walkthrough to see some great examples of how to test real code)
Features
Simple test setup and quirky (yet intuitive!) test syntax
-- lua/tests/project_name/main.lua
return {
groupName = "MyProject",
cases = {
{
name = "Should create project tables",
func = function()
expect( MyProject ).to.exist()
end
}
}
}
Beautiful test output
Handsome, informative error reporting

Some additional reading:
Foreword about automated testing in GMod
Automated testing is a crucial part of any software workflow.
Your automated tests define a contract that give you and your would-be users confidence that the project will behave properly.
Without tests, you may find yourself spending large amounts of time debugging obscure issues.
Automated tests require more work up front, but will save you time and frustration in the future as your project grows.
Traditionally, Garry's Mod developers have included, at most, a few crucial tests with their codebase - usually only ran manually when the maintainer remembers.
Modern testing infrastructure allow you to run your tests on a Pull Request, before the code has made it into the main branch.
Such a tool has never existed for Garry's Mod. Until now!
Technical info
GLuaTest was made to run on GitHub Actions, but it's flexible enough to fit anywhere you'd like.
You can use the GLuaTest Docker image to spin up a test server, run your tests, and see the output - all without having to install a server of your own.
This makes it easy to test your code in a real Garry's Mod environment without worrying about other addons or config values.
Usage
GLuaTest can be used in a number of ways. Whether you want to run your tests when you open a PR, or if you just want to have it run on your development server - we've got you covered.
Automated testing on Pull Requests
Run your tests in a Pull Request
To set up automated test runs, we'll use GitHub Workflows.
It's actually really simple to set up the workflow. Add the following file to your project:
name: GLuaTest Runner
on:
pull_request:
jobs:
run-tests:
uses: CFC-Servers/GLuaTest/.github/workflows/run_tests.yml@main
And that's it! The next time you make a PR, it'll spin up a new test server, run your project's test, and report any failures in your PR.
There are a couple of config options you can use though.