Open Asterune
TestService

TestService

Runs automated place tests and provides test assertions and input simulation.

Service
game:GetService("TestService")
Inherits
Instance
Replication
Never

Behavior

TestService runs automated place tests and provides test assertions and input simulation.

Summary

Members11
Properties4
  • Checks: number = 0parallel readread only

    The number of assertions recorded by the test run.

  • Failures: number = 0parallel readread only

    The number of failed assertions in the test run.

  • Input: TestInput = nilparallel readread only

    The TestInput interface used to simulate input.

  • Running: boolean = trueparallel readread only

    Whether an automated test run is active.

Methods5
Events2
  • Checked: RBXScriptSignalparallel read

    Fires when a test assertion is recorded.

  • Finished: RBXScriptSignalparallel read

    Fires when the test run finishes.

Properties

Checks

TestService.Checks: number = 0

The number of assertions recorded by the test run.

Failures

TestService.Failures: number = 0

The number of failed assertions in the test run.

Input

TestService.Input: TestInput = nil

The TestInput interface used to simulate input.

Running

TestService.Running: boolean = true

Whether an automated test run is active.

Methods

Check

TestService:Check(ok: boolean, description: string): boolean

Records a test assertion and whether it passed.

Fail

TestService:Fail(description: string): ()

Records a failed test assertion.

Finish

TestService:Finish(): TestSummary

Finishes the active test run.

GetExecutionGroup

TestService:GetExecutionGroup(): ExecutionGroup?

Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.

Summary

TestService:Summary(): TestSummary

Returns the test run's assertion and failure summary.

Events

Checked

TestService.Checked: RBXScriptSignal

Fires when a test assertion is recorded.

Finished

TestService.Finished: RBXScriptSignal

Fires when the test run finishes.

Inherited members

Inherited47

Instance