> This page is for SDKs, version Current (default).
> For other versions, use one of these documentation indexes:
> - Current (default): https://buildwithfern.com/learn/sdks/current/llms.txt
> - Legacy: https://buildwithfern.com/learn/sdks/legacy/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

# Testing

> Fern automatically generates unit tests and mock server tests for SDKs to ensure quality before release

Fern provides comprehensive testing for your SDKs through generated and handwritten tests.

## Generated tests

Fern auto-generates tests that must pass before SDK release. Fern generates a GitHub workflow in each SDK repository that runs unit tests and any enabled mock server tests on every pull request, commit, and release.

### Unit tests

Fern generates unit tests for all SDK languages. They verify individual methods in isolation without making network calls.

### Mock server tests

> **Enterprise feature**
>
> This feature is available only for the [Enterprise plan](https://buildwithfern.com/pricing). To get started, reach out to [support@buildwithfern.com](mailto:support@buildwithfern.com).

Mock server (wire) tests run your SDK against a mock server generated from your API definition. They verify that the SDK sends HTTP requests and receives HTTP responses as expected. These tests are generated for all endpoints in a service.

Mock server tests are available for TypeScript, Python, Go, Java, C#, PHP, Swift, Rust, and Ruby. Enable or disable mock server tests with [`generation.wireTests.enabled`](/learn/sdks/reference/sdk-config#generation) in `sdk-config.yml`, either in the top-level `generation` block or in a target's `generation` block:

**`sdk-config.yml`**

```yaml title="sdk-config.yml"
generation:
  wireTests:
    enabled: true
```

When `wireTests.enabled` isn't set, the default depends on the language:

| Language   | Default |
| ---------- | ------- |
| TypeScript | true    |
| Python     | false   |
| Go         | true    |
| Java       | false   |
| .NET/C#    | true    |
| PHP        | false   |
| Swift      | true    |
| Rust       | false   |
| Ruby       | false   |

## Integration tests

> **Enterprise feature**
>
> This feature is available only for the [Enterprise plan](https://buildwithfern.com/pricing). To get started, reach out to [support@buildwithfern.com](mailto:support@buildwithfern.com).

Handwritten integration tests run against your real API server to test end-to-end functionality with live data.

## Adding additional tests

You can add custom tests directly to your SDK repositories. Include test files in your `.fernignore` file to prevent overwrites during regeneration.