---
name: TestSuite
last_updated: 2026-11-16T22:19:01Z
inherits:
  - Object
type: class
memory_category: Instances
tags:
  - NotCreatable
  - NotReplicated
summary: "A named group of tests that share tags and a timeout."
---

# Class: TestSuite

> A named group of tests that share tags and a timeout.

## Description

A `TestSuite` groups related tests. Create one with
[TestService:RegisterSuite()](/docs/reference/engine/classes/TestService.md) and add tests to it with
[RegisterTest()](/docs/reference/engine/classes/TestSuite.md). Every test in the suite gets
the suite's tags and timeout, and the `Suite` filter of
[TestService:RunTestsAsync()](/docs/reference/engine/classes/TestService.md) runs the whole suite.

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

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

local Inventory = require(ReplicatedStorage.Inventory)

local inventory = TestService:RegisterSuite("Inventory", { Tags = { "data" }, TimeoutSec = 10 })

inventory:RegisterTest("starts empty", function(test)
	test:Check(#Inventory.new():GetItems(), 0)
end)

-- Overrides the suite's timeout and adds a tag
inventory:RegisterTest("loads saved items", function(test)
	local items = Inventory.load(123):GetItems()
	test:Check(#items, 3)
end, { Tags = { "slow" }, TimeoutSec = 30 })

TestService:RunTestsAsync({ Suite = "Inventory" })
```

## Properties

### Property: TestSuite.SuiteName

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

The name passed to [TestService:RegisterSuite()](/docs/reference/engine/classes/TestService.md). Each test in the
suite reports it as its [TestCase.SuiteName](/docs/reference/engine/classes/TestCase.md).

### Property: TestSuite.TimeoutSec

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

The timeout, in seconds, that tests registered in this suite get unless
they set their own `TimeoutSec`. It comes from the `TimeoutSec` option of
[TestService:RegisterSuite()](/docs/reference/engine/classes/TestService.md) and defaults to `30`.

## Methods

### Method: TestSuite:GetTestTags

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

Returns the `Tags` the suite was registered with. Every test in the suite
has these tags in addition to its own.

*Security: None · Thread Safety: Unsafe*

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

### Method: TestSuite:RegisterTest

**Signature:** `TestSuite:RegisterTest(testName: string, callback: Function, options?: Dictionary): TestCase`

Registers a test in this suite. It works like
[TestService:RegisterTest()](/docs/reference/engine/classes/TestService.md), except that the test belongs to this
suite instead of the `Default` suite and starts with the suite's settings:

- The test's tags are its own `Tags` plus the suite's tags.
- The test uses the suite's [TimeoutSec](/docs/reference/engine/classes/TestSuite.md) unless
  it sets its own.

Throws an error if [TestService.Enabled](/docs/reference/engine/classes/TestService.md) is `false`, if `testName`
is empty or is already registered in this suite, if `Tags` isn't an array
of strings, or if `TimeoutSec` isn't a number from `0` to `86400`.

*Security: None · Thread Safety: Unsafe*

**Parameters:**

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `testName` | `string` |  | The name of the test. Must not be empty or already used in this suite. |
| `callback` | `Function` |  | The function that runs the test. It receives the test's [TestCase](/docs/reference/engine/classes/TestCase.md) and a [TestExecutionContext](/docs/reference/engine/classes/TestExecutionContext.md). |
| `options` | `Dictionary` | `nil` | Optional settings for the test: `Tags` (an array of strings) and `TimeoutSec` (a number of seconds). |

**Returns:** `TestCase` — The `TestCase` for the registered test.

## 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