-
Notifications
You must be signed in to change notification settings - Fork 12
/
black-box.test.js.snap
63 lines (56 loc) · 1.88 KB
/
black-box.test.js.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`black box test compiles kitty.ts 1`] = `
"export const GET = ($) => {
return $.response[200].random();
};
"
`;
exports[`black box test creates a file for the /hello/kitty path 1`] = `
"import type { HTTP_GET } from "../../path-types/hello/kitty.types.js";
export const GET: HTTP_GET = ($) => {
return $.response[200].random();
};
"
`;
exports[`black box test creates a type for the /hello/kitty path 1`] = `
"// This code was automatically generated from an OpenAPI description.
// Do not edit this file. Edit the OpenAPI file instead.
// For more information, see https://github.com/pmcelhaney/counterfact/blob/main/docs/faq-generated-code.md
import type { WideOperationArgument } from "../../types.d.ts";
import type { OmitValueWhenNever } from "../../types.d.ts";
import type { Context } from "../../paths/_.context.ts";
import type { ResponseBuilderFactory } from "../../types.d.ts";
import type { HttpStatusCode } from "../../types.d.ts";
export type HTTP_GET = (
$: OmitValueWhenNever<{
query: never;
path: never;
header: never;
body: never;
context: Context;
response: ResponseBuilderFactory<{
[statusCode in HttpStatusCode]: {
headers: never;
requiredHeaders: never;
content: {
"application/json": {
schema: string;
};
};
};
}>;
x: WideOperationArgument;
proxy: (url: string) => "COUNTERFACT_RESPONSE";
}>,
) =>
| {
status: number | undefined;
contentType?: "application/json";
body?: string;
}
| { status: 415; contentType: "text/plain"; body: string }
| "COUNTERFACT_RESPONSE"
| { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" };
"
`;
exports[`black box test responds to a GET request 1`] = `"<img src="https://upload.wikimedia.org/wikipedia/en/0/05/Hello_kitty_character_portrait.png">"`;