Aprenda
Classe do mecanismo
TestService
Serviço

*Este conteúdo é traduzido por IA (Beta) e pode conter erros. Para ver a página em inglês, clique aqui.


Resumo
Métodos
Check(condition: boolean,description: string,source: Instance,line: number):()
Checkpoint(text: string,source: Instance,line: number):()
Done():()
Error(description: string,source: Instance,line: number):()
Fail(description: string,source: Instance,line: number):()
Message(text: string,source: Instance,line: number):()
RegisterTest(testOptions: Dictionary):TestCase
Require(condition: boolean,description: string,source: Instance,line: number):()
Run():()
Obsoleto
TakeSnapshot(snapshotname: string,source: Instance):()
Warn(condition: boolean,description: string,source: Instance,line: number):()
Membros herdados

Referência API
Propriedades
AutoRuns
Ler Parallel
TestService.AutoRuns:boolean

Description
Ler Parallel
TestService.Description:string

ErrorCount
Somente leitura
Não replicado
Ler Parallel
TestService.ErrorCount:number

ExecuteWithStudioRun
Ler Parallel
TestService.ExecuteWithStudioRun:boolean

Is30FpsThrottleEnabled
Obsoleto

IsPhysicsEnvironmentalThrottled
Ler Parallel
TestService.IsPhysicsEnvironmentalThrottled:boolean

IsSleepAllowed
Ler Parallel
TestService.IsSleepAllowed:boolean

NumberOfPlayers
Ler Parallel
TestService.NumberOfPlayers:number

SimulateSecondsLag
Ler Parallel
TestService.SimulateSecondsLag:number

TestCount
Somente leitura
Não replicado
Ler Parallel
TestService.TestCount:number

ThrottlePhysicsToRealtime
Ler Parallel
TestService.ThrottlePhysicsToRealtime:boolean

Timeout
Ler Parallel
TestService.Timeout:number

WarnCount
Somente leitura
Não replicado
Ler Parallel
TestService.WarnCount:number

Métodos
Check
TestService:Check(
condition:boolean, description:string, source:Instance, line:number
):()
Parâmetros
condition:boolean
description:string
source:Instance
Valor Padrão: "nil"
line:number
Valor Padrão: 0
Devolução
()
Amostras de código
TestService:Check
local TestService = game:GetService("TestService")
-- Este trecho de código chama a função Check com os parâmetros fornecidos TestService:Check(false, "exemplo")

Checkpoint
TestService:Checkpoint(
text:string, source:Instance, line:number
):()
Parâmetros
text:string
source:Instance
Valor Padrão: "nil"
line:number
Valor Padrão: 0
Devolução
()
Amostras de código
TestService:PontoDeVerificação
local TestService = game:GetService("TestService")
TestService:Checkpoint("exemplo")

Done
TestService:Done():()
Devolução
()
Amostras de código
TestService:Feito
local TestService = game:GetService("TestService")
-- Este método indica que o teste foi concluído TestService:Done()

Error
TestService:Error(
description:string, source:Instance, line:number
):()
Parâmetros
description:string
source:Instance
Valor Padrão: "nil"
line:number
Valor Padrão: 0
Devolução
()
Amostras de código
TestService:Erro
local TestService = game:GetService("TestService")
TestService:Error("isto é um erro")

Fail
TestService:Fail(
description:string, source:Instance, line:number
):()
Parâmetros
description:string
source:Instance
Valor Padrão: "nil"
line:number
Valor Padrão: 0
Devolução
()

isFeatureEnabled
TestService:isFeatureEnabled(name:string):boolean
Parâmetros
name:string
Devolução

Message
TestService:Message(
text:string, source:Instance, line:number
):()
Parâmetros
text:string
source:Instance
Valor Padrão: "nil"
line:number
Valor Padrão: 0
Devolução
()
Amostras de código
TestService:Mensagem
local TestService = game:GetService("TestService")
TestService:Mensagem("exemplo")

RegisterTest
TestService:RegisterTest(testOptions:Dictionary):TestCase
Parâmetros
testOptions:Dictionary
Devolução
TestCase

Require
TestService:Require(
condition:boolean, description:string, source:Instance, line:number
):()
Parâmetros
condition:boolean
description:string
source:Instance
Valor Padrão: "nil"
line:number
Valor Padrão: 0
Devolução
()
Amostras de código
TestService:Require
local TestService = game:GetService("TestService")
TestService:Require(false, "exemplo")

Run
Obsoleto

RunAsync
Rendimentos
Segurança do plugin
TestService:RunAsync():()
Devolução
()

ScopeTime
TestService:ScopeTime():Dictionary
Devolução

TakeSnapshot
TestService:TakeSnapshot(
snapshotname:string, source:Instance
):()
Parâmetros
snapshotname:string
source:Instance
Valor Padrão: "nil"
Devolução
()

Warn
TestService:Warn(
condition:boolean, description:string, source:Instance, line:number
):()
Parâmetros
condition:boolean
description:string
source:Instance
Valor Padrão: "nil"
line:number
Valor Padrão: 0
Devolução
()
Amostras de código
TestService:Warn
local TestService = game:GetService("TestService")
TestService:Warn(false, "esta ação é inválida")

Eventos
ServerCollectConditionalResult
TestService.ServerCollectConditionalResult(
condition:boolean, text:string, script:Instance, line:number
Parâmetros
condition:boolean
text:string
script:Instance
line:number

ServerCollectResult
TestService.ServerCollectResult(
text:string, script:Instance, line:number
Parâmetros
text:string
script:Instance
line:number

©2026 Roblox Corporation, Roblox, o logotipo Roblox e Powering Imagination estão entre nossas marcas registradas e não registradas nos EUA e em outros países.