Skip to content

Commit f8fd737

Browse files
committed
add configuration options
1 parent fb28a9b commit f8fd737

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

fern/products/sdks/guides/testing.mdx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,23 @@ Fern provides comprehensive testing for your SDKs through generated and handwrit
99

1010
<Markdown src="/snippets/pro-plan.mdx"/>
1111

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-
12+
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.
1413

1514
### Unit tests
1615

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

1918
### Mock server tests
2019

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.
20+
Mock server (wire) tests run your SDK against a mock server generated from your API definition. They verify that the SDK sends and receives HTTP requests as expected. These tests are generated for all endpoints in a service.
21+
22+
Mock server tests are available for TypeScript, Go, and Java. Configure mock server tests in your `generators.yml`:
2223

23-
Mock server tests are available for TypeScript, Go, and Java.
24+
| Language | Configuration | Default |
25+
|----------|---------------|---------|
26+
| TypeScript | [`generateWireTests`](/sdks/generators/typescript/configuration#generatewiretests) | true |
27+
| Go | [`enableWireTests`](/sdks/generators/go/configuration#enablewiretests) | false |
28+
| Java | [`enable-wire-tests`](/sdks/generators/java/configuration#enablewiretests) | false |
2429

2530
## Integration tests
2631

fern/products/sdks/overview/go/configuration.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ Specifies the name of the generated client struct. This determines the primary c
3636
Sets the name of the exported client that will be used in code snippets and documentation examples. This is useful for customizing how the client appears in generated documentation.
3737
</ParamField>
3838
39+
<ParamField path="enableWireTests" type="string" default="false" required={false} toc={true}>
40+
When enabled, generates [mock server (wire) tests](/sdks/deep-dives/testing#mock-server-tests) to verify that the SDK sends and receives HTTP requests as expected.
41+
</ParamField>
42+
3943
<ParamField path="importPath" type="string" required={false} toc={true}>
4044
Use this option if you plan to depend on the generated Go SDK from within your project, and **not** depend on it as a separate, published Go module.
4145

fern/products/sdks/overview/java/configuration.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ When enabled, generates inline types for nested schemas instead of creating sepa
6666
When enabled, generates public constructors for model types.
6767
</ParamField>
6868
69+
<ParamField path="enable-wire-tests" type="boolean" default="false" required={false} toc={true}>
70+
When enabled, generates [mock server (wire) tests](/sdks/deep-dives/testing#mock-server-tests) to verify that the SDK sends and receives HTTP requests as expected.
71+
</ParamField>
72+
6973
<ParamField path="generate-unknown-as-json-node" type="boolean" default="false" required={false} toc={true}>
7074
When enabled, generates unknown or untyped properties as structured JSON objects instead of raw Object types. This provides better type safety and easier manipulation of dynamic JSON content while maintaining flexibility for unknown data structures.
7175
</ParamField>

fern/products/sdks/overview/typescript/configuration.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ Choose whether you want to support Node.js 16 and above (`Node16`), or Node.js 1
172172
* `Node18` uses the native FormData API, and accepts a wider range of types for file uploads, such as `Buffer`, `File`, `Blob`, `Readable`, `ReadableStream`, `ArrayBuffer`, and `Uint8Array`
173173
</ParamField>
174174

175+
<ParamField path="generateWireTests" type="boolean" default="true" toc={true}>
176+
Generates [mock server (wire) tests](/sdks/deep-dives/testing#mock-server-tests) to verify that the SDK sends and receives HTTP requests as expected.
177+
</ParamField>
178+
175179
<ParamField path="includeContentHeadersOnFileDownloadResponse" type="boolean" toc={true}>
176180

177181
Includes the content type and content length from binary responses. The user will receive an object of the following type:

0 commit comments

Comments
 (0)