Avant - Unit Testing Plugin

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:

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

ModuleScripts 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 and getfenv() 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.

8 Likes

“Buy For $199.99”
“I already paid.”

If paying for this is completely optional, as you stated in the post, you should honestly just allow people to donate or pay a variable price IMO. I know a lot of people that wouldn’t even spend a dime on a Roblox plugin, so even if people do get the intended value I doubt they’ll pay you 200 dollars when they just don’t have to.

Also, 99% sure you can fork the plugin to remove the I already paid reminder anyways.

1 Like

The message is more-or-less meant to “suggest” paying for it, and targeted towards larger developers/studios where $200+ for a testing tool is easy to justify. Unit testing is super niche on Roblox, but highly used by those who do, so if someone can’t justify a high price, they most likely can’t justify any price. If I set the minimum price low (like $20), that is the price most will pay and never look back. “Pay what you want” on Itch with no minimum netted <$100 in sales over the past couple of years, and suggesting this higher price + the non-paid message is meant to make Avant easier to justify support for.

As for variable pricing, here is a good reason I put Itch’s link above Roblox’s: if you want to pay more, you can. Roblox decided, after years of promising it, that we won’t get it.

That 99% can be 100%. The plugin is entirely open-source with the permissive MIT license. The check for the message is super easy to remove. Part of the point of the “I already paid.” option is to give people a reason not to do that. If I don’t provide it, people will hate me for making it so they have to fork it to remove it. With it, they can roll their eyes at the message but use the master copy as-is and get updates as they come up.

2 Likes