> For the complete documentation index, see [llms.txt](https://docs.midio.com/midio-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.midio.com/midio-docs/guides/writing-tests.md).

# Writing tests

## Adding a new test

Midio comes with a simple interface for writing and running tests, found in the [`Testing`](/midio-docs/built-in-nodes/core-std.md#testing) module.

To add a test, first add a [`Testing Test`](/midio-docs/built-in-nodes/core-std.md#test) event node, and give it a name.

<figure><img src="/files/Xog9JtRrL5HoviTA5nFF" alt="" width="496"><figcaption></figcaption></figure>

If you open the 'Services' panel and click the 'refresh services list' button, you will get a new item called **Testing**. Click it to get an overview of all your tests, and buttons to execute them.

<figure><img src="/files/FqV7mdQWrqz5M2R2EXIg" alt=""><figcaption></figcaption></figure>

## Assertions

The Testing module contains several functions which can be used to perform assertions during a test, like `Testing.AssertEqual`. These functions can only be used in the context of a test, and will report to the testing service whether they pass or fail.

<figure><img src="/files/mVsal2NzBGQRkvFoDiMj" alt="" width="563"><figcaption></figcaption></figure>

You can then click on the **Run all** button to run all tests, or the individual **Run** buttons to run a single test at a time.

<figure><img src="/files/d6dFO9lHxO43TMpBapb4" alt="" width="332"><figcaption></figcaption></figure>

## Tips

Clicking on a test in the services panel will make the editor jump directly to where that test is defined.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.midio.com/midio-docs/guides/writing-tests.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
