Test files

Test files describe the tests for the API endpoints. See Test and deploy.

Test files are stored in the tests folder in your project.

Test file format

Test files are YAML files that contain the tests for the API endpoints.

Test files are structured as YAML arrays. For example:

- name: test_default_parameters
  description: 'Test with default parameters: org_id=1, start_date=30 days ago, end_date=now.'
  parameters: org_id=1
  expected_result: ''

- name: test_custom_org_id
  description: Test with a custom organization ID and default date range.
  parameters: org_id=42
  expected_result: ''

Each test is a YAML object with the following fields:

  • name: The name of the test.
  • description: The description of the test.
  • parameters: The query parameters for the endpoint.
  • expected_result: The expected result for the test.
  • expected_http_status: The expected HTTP status, for example 200.

Create a test file

To create a test file, run tb test create against an endpoint .pipe file. See tb test create.

Run tests

To run tests, run tb test run. See tb test run.

Updated