> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xano.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing

> Run unit tests and workflow tests from the CLI

The CLI provides commands for running both unit tests and workflow tests, letting you validate your backend logic directly from the terminal.

> [!NOTE]
>
> Test commands require a workspace ID, either from your profile or via the `-w` flag.

## Unit Tests

Unit tests validate individual functions and logic blocks.

### List Unit Tests

Terminal

```bash theme={null}
xano unit_test list
```

Filter by branch or object type:

Terminal

```bash theme={null}
xano unit_test list --branch dev --obj-type function
```

### Run a Unit Test

Terminal

```bash theme={null}
xano unit_test run UNIT_TEST_ID
```

### Run All Unit Tests

Terminal

```bash theme={null}
xano unit_test run_all
```

Filter by branch or object type:

Terminal

```bash theme={null}
xano unit_test run_all --branch dev --obj-type function
```

***

## Workflow Tests

Workflow tests validate end-to-end backend logic by running test suites.

### List Tests

Terminal

```bash theme={null}
xano workflow_test list
```

Filter by branch with `-b`:

Terminal

```bash theme={null}
xano workflow_test list -b dev
```

Use `-o json` for the full JSON response.

### Get Test Details

Terminal

```bash theme={null}
xano workflow_test get TEST_ID
```

| Flag | Description |
| - | - |
| `--include-draft` | Include the draft version of the test |
| `-o` | Output format: `summary`, `json`, or `xs` (XanoScript source) |

### Run a Test

Terminal

```bash theme={null}
xano workflow_test run TEST_ID
```

### Run All Tests

Run every workflow test in the workspace:

Terminal

```bash theme={null}
xano workflow_test run_all
```

Filter by branch with `-b`:

Terminal

```bash theme={null}
xano workflow_test run_all -b dev
```

### Delete a Test

Terminal

```bash theme={null}
xano workflow_test delete TEST_ID
```

Add `-f` to skip the confirmation prompt.


## Related topics

- [Sandbox Testing](https://docs.xano.com/testing-debugging/sandbox.md)
- [Testing And Debugging Function Stacks](https://docs.xano.com/testing-debugging/testing-and-debugging-function-stacks.md)
- [The Development Life Cycle](https://docs.xano.com/before-you-begin/the-development-life-cycle.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.