Skip to content

Commit fb28a9b

Browse files
committed
add new testing page
1 parent 8c2a9db commit fb28a9b

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed

fern/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ redirects:
196196
- source: /learn/sdks/capabilities/idempotency-headers
197197
destination: /learn/sdks/deep-dives/idempotency
198198
permanent: true
199+
- source: /learn/sdks/capabilities/integration-tests
200+
destination: /learn/sdks/deep-dives/testing
201+
permanent: true
199202

200203
# SDK Package Managers redirects
201204
- source: /learn/sdks/package-managers/:slug*

fern/products/sdks/capabilities.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ layout: overview
6060
<Card title="Server-Sent Events" icon="fa-duotone fa-broadcast-tower">
6161
Stream JSON data from your server to your client (i.e. chat completions)
6262
</Card>
63-
<Card title="Integration Tests" icon="fa-duotone fa-flask">
64-
Test your SDK against a mock server
63+
<Card title="Testing" icon="fa-duotone fa-flask" href="/sdks/deep-dives/testing">
64+
Auto-generated and handwritten tests to ensure your SDK works in production
6565
</Card>
6666
<Card title="Code Snippets" icon="fa-duotone fa-brackets-curly">
6767
No longer depend on manually written code snippets
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Testing
3+
description: Fern automatically generates unit tests and mock server tests for SDKs to ensure quality before release
4+
---
5+
6+
Fern provides comprehensive testing for your SDKs through generated and handwritten tests.
7+
8+
## Generated tests
9+
10+
<Markdown src="/snippets/pro-plan.mdx"/>
11+
12+
Fern auto-generates tests that must pass before SDK release. Fern generates a GitHub workflow in each SDK repository that runs unit and mock server tests on every pull request, commit, and release.
13+
14+
15+
### Unit tests
16+
17+
Fern generates unit tests for all SDK languages. They verify individual methods in isolation without making network calls.
18+
19+
### Mock server tests
20+
21+
Mock server (wire) tests run your SDK against a mock server generated from your API definition. They validate serialization, endpoints, headers, and status code handling.
22+
23+
Mock server tests are available for TypeScript, Go, and Java.
24+
25+
## Integration tests
26+
27+
<Markdown src="/snippets/enterprise-plan.mdx"/>
28+
29+
Handwritten integration tests run against your real API server to test end-to-end functionality with live data.
30+
31+
## Adding additional tests
32+
33+
You can add custom tests directly to your SDK repositories. Include test files in your `.fernignore` file to prevent overwrites during regeneration.

fern/products/sdks/sdks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ navigation:
234234
- page: Self-hosted SDKs
235235
path: ./guides/self-hosted.mdx
236236
slug: self-hosted
237+
- page: Testing
238+
path: ./guides/testing.mdx
237239
- section: Reference
238240
contents:
239241
- page: generators.yml

0 commit comments

Comments
 (0)