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

# bazable test

> Send HTTP requests to contracted endpoints

Sends real HTTP requests to every contracted endpoint and reports health.

## Usage

```bash theme={null}
bazable test [options]
```

## Options

<ParamField query="-t, --token" type="string">
  Access token for authenticated endpoints.
</ParamField>

<ParamField query="-e, --email" type="string">
  Auto-login email.
</ParamField>

<ParamField query="-p, --password" type="string">
  Auto-login password.
</ParamField>

<ParamField query="-m, --method" default="GET" type="string">
  HTTP method to use when testing.
</ParamField>

<ParamField query="-w, --write" type="boolean">
  Allow testing of write endpoints (POST, PUT, PATCH, DELETE).
</ParamField>

<ParamField query="-k, --mock" type="boolean">
  Mock mode. Does not send real HTTP requests.
</ParamField>

<ParamField query="-a, --all" type="boolean">
  Test all endpoints regardless of status.
</ParamField>

<ParamField query="-x, --exclude" type="string[]">
  Skip specific endpoints by URL.
</ParamField>

<ParamField query="--newman" type="boolean">
  Run the tests through Newman. Bazable generates a temporary Postman collection and executes it.
</ParamField>

<ParamField query="--reporter" default="cli" type="string">
  Comma-separated Newman reporters (for example `cli`, `junit`, `cli,junit`). Only used with `--newman`.
</ParamField>

<ParamField query="--env-var" type="string[]">
  Environment variables passed to Newman as `key=value`. May be repeated. Only used with `--newman`.
</ParamField>

<Warning>
  Use `--write` with care against live APIs. It will send POST, PUT, PATCH, and DELETE requests.
</Warning>

## Newman mode

With `--newman`, Bazable:

1. Reads your contract.
2. Generates a Postman collection (same logic as [`bazable export --postman`](/commands/export)).
3. Runs `newman run` on that collection.
4. Exits with code `0` if all tests pass, `1` otherwise.

<Note>
  If you have stored credentials from [`bazable login`](/cloud/login), the token is automatically injected as the `token` environment variable in the Newman run.
</Note>

<Tip>
  Newman is optional. If it is not installed globally, Bazable falls back to `npx newman`. Install with `npm i -g newman` for faster runs in CI.
</Tip>

## Examples

<CodeGroup>
  ```bash Mock-test all theme={null}
  bazable test -k -a
  ```

  ```bash Real test with auto-login theme={null}
  bazable test -e admin@example.com -p secret123 -m POST -w
  ```

  ```bash Newman with multiple reporters theme={null}
  bazable test --newman --reporter cli,junit
  ```

  ```bash Newman with env vars theme={null}
  bazable test --newman --env-var TOKEN=abc123 --env-var API_BASE=https://api.example.com
  ```
</CodeGroup>

See [Postman Integration](/guides/postman) for the full Postman/Newman workflow.


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