---
name: TestResult
last_updated: 2026-11-16T22:19:01Z
inherits:
  - Object
type: class
memory_category: Instances
tags:
  - NotCreatable
  - NotReplicated
summary: "The outcome of one test in a test run."
---

# Class: TestResult

> The outcome of one test in a test run.

## Description

A `TestResult` is the outcome of one test in a run started by
[TestService:RunTestsAsync()](/docs/reference/engine/classes/TestService.md). Get them from
[TestRunResult:GetTests()](/docs/reference/engine/classes/TestRunResult.md).

[Status](/docs/reference/engine/classes/TestResult.md) says how the test ended. For a test that
didn't pass, [GetFailures()](/docs/reference/engine/classes/TestResult.md) lists the checks
that failed, [UncaughtError](/docs/reference/engine/classes/TestResult.md) holds any error
the test threw, and [SkipReason](/docs/reference/engine/classes/TestResult.md) says why a
skipped test was skipped.

A `TestResult` isn't an [Instance](/docs/reference/engine/classes/Instance.md) and can't be parented.

```lua
local TestService = game:GetService("TestService")

local result = TestService:RunTestsAsync()
for _, test in result:GetTests() do
	if test.Status == Enum.TestCaseStatus.Skipped then
		print(`{test.TestId} skipped: {test.SkipReason}`)
	elseif test.Status == Enum.TestCaseStatus.TimedOut then
		warn(`{test.TestId} timed out after {test.Duration}s`)
	elseif test.UncaughtError ~= "" then
		warn(`{test.TestId} threw: {test.UncaughtError}`)
	elseif test.FailedChecks > 0 then
		warn(`{test.TestId}: {test.FailedChecks} of {test.PassedChecks + test.FailedChecks} checks failed`)
	end
end
```

## Properties

### Property: TestResult.Duration

```json
{
  "type": "double",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": false,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Data"
}
```

How long the test ran, in seconds, including any time it spent yielding.

### Property: TestResult.FailedChecks

```json
{
  "type": "int",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": false,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Data"
}
```

The number of [TestCase:Check()](/docs/reference/engine/classes/TestCase.md) and [TestCase:Require()](/docs/reference/engine/classes/TestCase.md)
calls in the test that failed.
[GetFailures()](/docs/reference/engine/classes/TestResult.md) returns the details of each
one, up to the first 1000. Past that,
[FailedChecks](/docs/reference/engine/classes/TestResult.md) keeps counting but no more
details are kept.

### Property: TestResult.PassedChecks

```json
{
  "type": "int",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": false,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Data"
}
```

The number of [TestCase:Check()](/docs/reference/engine/classes/TestCase.md) and [TestCase:Require()](/docs/reference/engine/classes/TestCase.md)
calls in the test that passed.

### Property: TestResult.SkipReason

```json
{
  "type": "string",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": false,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Data"
}
```

Why the test was skipped: the reason passed to
[TestExecutionContext:Skip()](/docs/reference/engine/classes/TestExecutionContext.md), or a message from the engine when it
skipped the test itself, for example because the script that registered
the test's callback no longer exists. It's empty if
[Status](/docs/reference/engine/classes/TestResult.md) isn't [TestCaseStatus.Skipped](/docs/reference/engine/enums/TestCaseStatus.md), or
if the test called [TestExecutionContext:Skip()](/docs/reference/engine/classes/TestExecutionContext.md) without a reason.

### Property: TestResult.Status

```json
{
  "type": "TestCaseStatus",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": false,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Data"
}
```

How the test ended: [TestCaseStatus.Pass](/docs/reference/engine/enums/TestCaseStatus.md),
[TestCaseStatus.Fail](/docs/reference/engine/enums/TestCaseStatus.md), [TestCaseStatus.TimedOut](/docs/reference/engine/enums/TestCaseStatus.md), or
[TestCaseStatus.Skipped](/docs/reference/engine/enums/TestCaseStatus.md). More statuses may be added later, so treat
a status you don't recognize as "didn't pass."

### Property: TestResult.SuiteName

```json
{
  "type": "string",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": false,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Data"
}
```

The [TestCase.SuiteName](/docs/reference/engine/classes/TestCase.md) of the test this result is for.

### Property: TestResult.TestId

```json
{
  "type": "string",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": false,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Data"
}
```

The [TestCase.TestId](/docs/reference/engine/classes/TestCase.md) of the test this result is for. Pass it as the
`TestId` filter of [TestService:RunTestsAsync()](/docs/reference/engine/classes/TestService.md) to run the test
again on its own.

### Property: TestResult.TestName

```json
{
  "type": "string",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": false,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Data"
}
```

The [TestCase.TestName](/docs/reference/engine/classes/TestCase.md) of the test this result is for.

### Property: TestResult.UncaughtError

```json
{
  "type": "string",
  "access": "ReadWrite",
  "security": {
    "read": "None",
    "write": "None"
  },
  "serialization": {
    "can_load": false,
    "can_save": true
  },
  "thread_safety": "ReadSafe",
  "category": "Data"
}
```

The message of an error that ended the test's callback and that no check
accounts for, such as indexing `nil`. If the callback threw something
other than a string or number, such as a table, an Instance, or `nil`, or
threw an empty string, this is a general message from the engine. For a
test the place's script timeout stopped, [Status](/docs/reference/engine/classes/TestResult.md)
is [TestCaseStatus.TimedOut](/docs/reference/engine/enums/TestCaseStatus.md) and this holds the timeout error.

It's empty when the test didn't throw, and also when it stopped because of
a failed [TestCase:Require()](/docs/reference/engine/classes/TestCase.md) or
[TestExecutionContext:Skip()](/docs/reference/engine/classes/TestExecutionContext.md). Those are reported through
[GetFailures()](/docs/reference/engine/classes/TestResult.md) and
[SkipReason](/docs/reference/engine/classes/TestResult.md) instead.

## Methods

### Method: TestResult:GetFailures

**Signature:** `TestResult:GetFailures(): Array`

Returns a [TestFailure](/docs/reference/engine/classes/TestFailure.md) for each [TestCase:Check()](/docs/reference/engine/classes/TestCase.md) and
[TestCase:Require()](/docs/reference/engine/classes/TestCase.md) call that failed in the test, in the order they
failed, up to the first 1000. The array is empty if no check failed, even
when the test failed by throwing an error; see
[UncaughtError](/docs/reference/engine/classes/TestResult.md) for that.

*Security: None · Thread Safety: Unsafe*

**Returns:** `Array` — An array of [TestFailure](/docs/reference/engine/classes/TestFailure.md) objects, in the order the checks
failed.

### Method: TestResult:GetTestTags

**Signature:** `TestResult:GetTestTags(): Array`

Returns the tags of the test this result is for, the same as
[TestCase:GetTestTags()](/docs/reference/engine/classes/TestCase.md).

*Security: None · Thread Safety: Unsafe*

**Returns:** `Array` — An array of strings.

## Inherited Members

### From [Object](/docs/reference/engine/classes/Object.md)

- **Property `ClassName`** (`string`): A read-only string representing the class this Object belongs to.
- **Property `className`** (`string`):  *(deprecated)*
- **Method `GetPropertyChangedSignal(property: string): RBXScriptSignal`**: Get an event that fires when a given property of the object changes.
- **Method `IsA(className: string): boolean`**: Returns true if an object's class matches or inherits from a given class.
- **Method `isA(className: string): boolean`**:  *(deprecated)*
- **Event `Changed`**: Fires immediately after a property of the object changes, with some