Avant is a plugin for running unit tests in Roblox Studio. It is the successor and complete rewrite of Nexus Unit Testing.
It currently contains 2 parts:
- Avant Runtime - Core test running library.
- Avant Plugin - Roblox Studio plugin for running tests (this post).
Why Unit Test
Most developers on the Roblox platform use manual testing for developing systems. While this works for most games, manual testing is a long and fault-prone activity that still leads to major bugs reaching players. Unit testing provides a fast and consistent way to test the logic of games, plugins, and subsystems for cases that could come up in production, both as common cases and edge cases.
Writing Unit Tests
Tests can be written and run using TestEZ. Jest is currently not supported due to difficulty with integrating. Help is wanted in Avant Runtime to get this done.
Tests will show up in the test list as long as the ModuleScript
ends with .spec
in the name. They can be run and re-run. Any test can be double-clicked to view the output, with a blue dot to indicate it has output.
Compared to Nexus Unit Testing
For a complete list, see the releases for Avant Runtime and Avant Plugin.
ModuleScript
Tracking
ModuleScript
s are now tracked, which will make them show up when created and indicate when the test is changed or removed.
Test State Reuse
When tests are re-run, the test state is re-used when possible to avoid issues with scrolling and re-opening the updated output.
Long Output Loading
Loading the output of tests as they come in is now significantly more performant.
Other Smaller Changes
- Moved from using a custom plugin framework to Fusion.
- Information about no detected tests is presented without running (as opposed to after the first run).
- Fixed the test list stuttering with deferred events.
- Fixed test durations not always showing with deferred events.
- Fixed errors in
beforeEach
/beforeAll
/afterEach
/afterAll
not appearing in the test. - Fixed
loadstring
andgetfenv()
causing output to not go to the running test. - Fixed test output not always loading after re-running tests.
- Fixed the last test time not showing the local time.
Future Plans
Jest Support
Support for Jest has been requested for a few, and it is not part of the launch because I just couldn’t figure out how to integrate it. I’m looking for help from those more used to the internals of Jest to get it supported.
CI Runner
With Open Cloud Luau execution, continuous integration is now possible but a lot of setup. At some point in 2025, I plan to look into making a utility where you set up a configuration file, and then download and run an executable in a build pipeline. Since I manage double-digit projects, this is something I need to be simple to integrate.
Other Test Runners?
A problem with Nexus Unit Testing’s original architecture is the logic for running tests and the state were combined. With Avant, test runners operate on their own and update/create test data when needed. Jest will be easier to integrate compared to if it was done with Nexus Unit Testing, and there is room for more. Elttob’s tinest is an example of a new test library that could be integrated if there is demand.
Pricing
Avant is sold as a paid plugin on Itch and Roblox. This can be thought of as a license to use the tool. Free versions (GitHub releases or source code) will display a message if you aren’t using a paid version. However, this is more of a “suggestion” since the full functionality is available with the “I already paid” button. This button is meant to be used if you paid for the plugin elsewhere (or paid for Nexus Unit Testing through Itch) or you want to try it before buying it… but it can be used without that. I just request you pay if you see yourself getting the intended value out of this plugin (mainly in the time saved for finding a bug in a unit test instead of manual testing or later).
Note: if you paid for the plugin through Roblox already, it has been replaced in-place with Avant. Updating Nexus Unit Testing through Roblox Studio will replace Nexus Unit Testing with Avant.