Building a Unit Test
The fastest way to create a unit test is by using Run & Debug. Once you are achieving the desired result by running your function stack, you can click Create Unit Test under the result.



- Inputs align with the inputs that your function stack expects. You can fill out any desired values here that you would like to use to run the test. If you used the Create Unit Test option in Run & Debug, this should already be populated for you.
- Expects are the statements that are used to validate your test. These could be anything from a simple equals statement, or use more complex operators based on your needs.
- Use the ✏️ button to delete expect statements.
- Use the ⏩ button to check all expect statements, or you can run them selectively with the ▶️ button.

Using the Testing Suite
Once you have your unit tests built, you can always run them individually from that API’s testing panel. If you want to run all of your tests at once, you can use the testing suite.

- Review where your application has and is missing coverage.
- Run all tests at once.
Mocking Responses
For each of the functions in your function stack, you can add mock responses to assist in the consistency of your unit tests.1
Right-click on a function and choose Mock Test Response

2
In the panel that opens on the right, you can add mock data for this function that will be used during your unit test.
You can specify different pieces of data for each individual unit test you’ve built for this function stack.
