Avant Runtime is a library used to run unit tests on Roblox. For the plugin, see Avant-Plugin.
This is the successor to Nexus Unit Testing.
describe
, it
, and others, as well as properly starting tests with the
developer-provied runtime.
Avant exists to provide the following:
- Provide a common interface that can be used with multiple test libraries (TestEZ, Jest).
- Improve test isolation and re-running by allowing
ModuleScript
s to berequire
d multiple times. - Isolate and store the output of individual tests.
For TestEZ, see TestEZ's docs.
In order for tests to be detected, the name of the ModuleScript
must
end with .spec
.
This is not relevant for the plugin.
Avant provides a simple test runner for quick testing with RunTests
.
It can be used as a reference for custom runners.
local RunTests = require(game:GetService("TestService").AvantRuntime.RunTests) --Replace with where the module is.
local Results = RunTests() --Returns a table with the total NOT_RUN, PASSED, FAILED, and SKIPPED tests.
Avant Runtime is available under the terms of the MIT License. See LICENSE for details.