Skip to main content
Version: 1.1.2

Configuration

After running testosa --init, you'll have a config file, testosa.config.json file in your working directory. In your config file, you will see some settings declared like this:

{
   "apiBaseUrl": "<YOUR_API_BASE_URL>",
   "openApiFilePath": "<PATH_TO_YOUR_OPEN_API_FILE>"
}

Below is a full list of settings to configure the behaviour of Testosa for your test runs.

Options

The options below can be used in both your testosa.config.js and as CLI arguments if supplying settings directly from the command line.

apiBaseUrl [string<uri>] (required)

Base URL for the API server that you are validating your OpenAPI specification against.

  • Format: URI

apiServerStartupTimeout [integer]

At the start of each test run, this is the maximum time (in milliseconds) Testosa waits when verifying that your API server is reachable.

  • Default: 5000

excludedMethods [array<string>]

An array of HTTP methods that should be skipped when generating tests. Testosa will not attempt to test any method + path combination that includes a method specified in this array.

  • Allowed values: DELETE, GET, OPTIONS, PATCH, POST, PUT, TRACE

excludedStatusCodes [array<integer>]

An array of HTTP status codes that should be skipped when generating tests. Testosa will not attempt to test any status code + path combination that includes a status code specified in this array. This proves useful when it is difficult to reliably trigger certain status codes (eg. 5xx);

  • Allowed values: >= 200 and <= 599

hooksFilePath [string]

If you're leveraging test hooks, include this option to specify the relative path to the JavaScript where your hooks are defined. See the Hooks section for creating and using hooks.

openApiFilePath [string] (required)

The relative file path to your OpenAPI specification file.