Need Better Explanation of TestService

Hi everyone,

so I’d consider myself an advanced scripter/programmer and I’ve used other unit testing frameworks before like NUnit and GoogleTest and they were simple enough to use. I just have an issue with Roblox’s TestService and it’s documentation. I’ve tried to google and look for anywhere that has some better documentation than the official API because it gives such a small amount of information to use.

I understand how to use the macros and such because when I tested it by running the “Run” function, it all was caught and shown in the output but what I don’t understand are some of the functions like “Done” and “Check”. Neither of them do what they say the documentations say they do. “Done” outputs nothing and when I give a conditional with “Check”, it also outputs nothing and I’m not too sure what the last two arguments really are meant for. Also the " isFeatureEnabled" function doesn’t seem to have any documentation at all to it so I’m not really sure what string I’m supposed to really place there for the argument.

If anyone can give a better explanation or in-depth explanation of what some of these functions do and how they’re used, that’d be great.

1 Like

TestService is mainly for Roblox Engineers to use, it’s just limitedly available to developers.

The documentation on some pages do seem a little outdated though, as their documented behavior is not their actual behavior. It also links an old 2012 blog post.

From what I can see, TestService::Check is similar to assert. If the first argument is true then it doesn’t print anything, but if it’s false, it prints: TestService: {DESCRIPTION} where “{DESCRIPTION}” is whatever the second argument you put for it.

local ran_int = math.random(2)
local value = ran_int == 1

game:GetService("TestService"):Check(value, "Integer is " .. ran_int)
--> if the condition is true, nothing prints AFAIK
--> if it's false, it prints: 'TestService: Integer is {NUMBER}'

The last two arguments are suppose to be the script and line it’s suppose to be shown from. Similar to how errors show the script and line it occurred on.

TestService::Done doesn’t seem to do anything anymore.

TestService.isFeatureEnabled seems to be replaced by UserSettings | Roblox Creator Documentation or GlobalSettings | Roblox Creator Documentation.

The functionalities that seem to not do anything anymore are probably disabled for developer use, serve a different purpose now, or only work internally.

All in all, I don’t recommend using the service.


Thanks for the explanation. That’s very muchly what I was thinking after trying to figure out what the brain puzzling documentation all means.