From fad983e272a91aab2f3f9f8339a768538f3092a5 Mon Sep 17 00:00:00 2001 From: Patrick McElhaney Date: Wed, 6 Sep 2023 10:54:40 -0400 Subject: [PATCH] update snapshots to match new format --- test/__snapshots__/black-box.test.js.snap | 10 +-- .../operation-type-coder.test.js.snap | 78 +++++++++---------- .../parameters-type-coder.test.js.snap | 8 +- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/test/__snapshots__/black-box.test.js.snap b/test/__snapshots__/black-box.test.js.snap index 625525ad..2eae8a7e 100644 --- a/test/__snapshots__/black-box.test.js.snap +++ b/test/__snapshots__/black-box.test.js.snap @@ -1,8 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`black box test compiles kitty.ts 1`] = ` -{ - "data": [ +Object { + "data": Array [ 101, 120, 112, @@ -81,8 +81,8 @@ exports[`black box test compiles kitty.ts 1`] = ` `; exports[`black box test creates a file for the /hello/kitty path 1`] = ` -{ - "data": [ +Object { + "data": Array [ 105, 109, 112, @@ -236,4 +236,4 @@ exports[`black box test creates a file for the /hello/kitty path 1`] = ` } `; -exports[`black box test responds to a GET request 1`] = `""`; +exports[`black box test responds to a GET request 1`] = `""`; diff --git a/test/typescript-generator/__snapshots__/operation-type-coder.test.js.snap b/test/typescript-generator/__snapshots__/operation-type-coder.test.js.snap index a02b73d5..a178d778 100644 --- a/test/typescript-generator/__snapshots__/operation-type-coder.test.js.snap +++ b/test/typescript-generator/__snapshots__/operation-type-coder.test.js.snap @@ -18,7 +18,7 @@ exports[`an OperationTypeCoder falls back to root level produces (OpenAPI 2) 1`] [statusCode in HttpStatusCode]: { headers: {}; content: { - "text/plain": { + \\"text/plain\\": { schema: Type; }; }; @@ -28,10 +28,10 @@ exports[`an OperationTypeCoder falls back to root level produces (OpenAPI 2) 1`] }) => | { status: number | undefined; - contentType?: "text/plain"; + contentType?: \\"text/plain\\"; body?: Type; } - | { status: 415; contentType: "text/plain"; body: string } + | { status: 415; contentType: \\"text/plain\\"; body: string } | void; " `; @@ -45,16 +45,16 @@ exports[`an OperationTypeCoder generates a complex post operation (OpenAPI 2 wit context, proxy, }: { - query: { "name?": string }; - path: { "id?": string }; - header: { "name?": string }; + query: { \\"name?\\": string }; + path: { \\"id?\\": string }; + header: { \\"name?\\": string }; body: Type; context: typeof default; response: ResponseBuilderFactory<{ 200: { headers: {}; content: { - "application/json": { + \\"application/json\\": { schema: Type; }; }; @@ -62,7 +62,7 @@ exports[`an OperationTypeCoder generates a complex post operation (OpenAPI 2 wit 400: { headers: {}; content: { - "application/json": { + \\"application/json\\": { schema: Type; }; }; @@ -70,7 +70,7 @@ exports[`an OperationTypeCoder generates a complex post operation (OpenAPI 2 wit [statusCode in Exclude]: { headers: {}; content: { - "application/json": { + \\"application/json\\": { schema: Type; }; }; @@ -80,20 +80,20 @@ exports[`an OperationTypeCoder generates a complex post operation (OpenAPI 2 wit }) => | { status: 200; - contentType?: "application/json"; + contentType?: \\"application/json\\"; body?: Type; } | { status: 400; - contentType?: "application/json"; + contentType?: \\"application/json\\"; body?: Type; } | { status: number | undefined; - contentType?: "application/json"; + contentType?: \\"application/json\\"; body?: Type; } - | { status: 415; contentType: "text/plain"; body: string } + | { status: 415; contentType: \\"text/plain\\"; body: string } | void; " `; @@ -107,16 +107,16 @@ exports[`an OperationTypeCoder generates a complex post operation (OpenAPI 2) 1` context, proxy, }: { - query: { "name?": string }; - path: { "id?": string }; - header: { "name?": string }; + query: { \\"name?\\": string }; + path: { \\"id?\\": string }; + header: { \\"name?\\": string }; body: Type; context: typeof default; response: ResponseBuilderFactory<{ 200: { headers: {}; content: { - "application/json": { + \\"application/json\\": { schema: Type; }; }; @@ -124,7 +124,7 @@ exports[`an OperationTypeCoder generates a complex post operation (OpenAPI 2) 1` 400: { headers: {}; content: { - "application/json": { + \\"application/json\\": { schema: Type; }; }; @@ -132,7 +132,7 @@ exports[`an OperationTypeCoder generates a complex post operation (OpenAPI 2) 1` [statusCode in Exclude]: { headers: {}; content: { - "application/json": { + \\"application/json\\": { schema: Type; }; }; @@ -142,20 +142,20 @@ exports[`an OperationTypeCoder generates a complex post operation (OpenAPI 2) 1` }) => | { status: 200; - contentType?: "application/json"; + contentType?: \\"application/json\\"; body?: Type; } | { status: 400; - contentType?: "application/json"; + contentType?: \\"application/json\\"; body?: Type; } | { status: number | undefined; - contentType?: "application/json"; + contentType?: \\"application/json\\"; body?: Type; } - | { status: 415; contentType: "text/plain"; body: string } + | { status: 415; contentType: \\"text/plain\\"; body: string } | void; " `; @@ -169,16 +169,16 @@ exports[`an OperationTypeCoder generates a complex post operation 1`] = ` context, proxy, }: { - query: { "name?": string }; - path: { "id?": string }; - header: { "name?": string }; + query: { \\"name?\\": string }; + path: { \\"id?\\": string }; + header: { \\"name?\\": string }; body: Type; context: typeof default; response: ResponseBuilderFactory<{ 200: { headers: {}; content: { - "application/json": { + \\"application/json\\": { schema: Type; }; }; @@ -186,7 +186,7 @@ exports[`an OperationTypeCoder generates a complex post operation 1`] = ` 400: { headers: {}; content: { - "application/json": { + \\"application/json\\": { schema: Type; }; }; @@ -194,7 +194,7 @@ exports[`an OperationTypeCoder generates a complex post operation 1`] = ` [statusCode in Exclude]: { headers: {}; content: { - "application/json": { + \\"application/json\\": { schema: Type; }; }; @@ -204,20 +204,20 @@ exports[`an OperationTypeCoder generates a complex post operation 1`] = ` }) => | { status: 200; - contentType?: "application/json"; + contentType?: \\"application/json\\"; body?: Type; } | { status: 400; - contentType?: "application/json"; + contentType?: \\"application/json\\"; body?: Type; } | { status: number | undefined; - contentType?: "application/json"; + contentType?: \\"application/json\\"; body?: Type; } - | { status: 415; contentType: "text/plain"; body: string } + | { status: 415; contentType: \\"text/plain\\"; body: string } | void; " `; @@ -240,7 +240,7 @@ exports[`an OperationTypeCoder generates a simple get operation (OpenAPI 2) 1`] [statusCode in HttpStatusCode]: { headers: {}; content: { - "application/json": { + \\"application/json\\": { schema: Type; }; }; @@ -250,10 +250,10 @@ exports[`an OperationTypeCoder generates a simple get operation (OpenAPI 2) 1`] }) => | { status: number | undefined; - contentType?: "application/json"; + contentType?: \\"application/json\\"; body?: Type; } - | { status: 415; contentType: "text/plain"; body: string } + | { status: 415; contentType: \\"text/plain\\"; body: string } | void; " `; @@ -276,7 +276,7 @@ exports[`an OperationTypeCoder generates a simple get operation 1`] = ` [statusCode in HttpStatusCode]: { headers: {}; content: { - "application/json": { + \\"application/json\\": { schema: Type; }; }; @@ -286,10 +286,10 @@ exports[`an OperationTypeCoder generates a simple get operation 1`] = ` }) => | { status: number | undefined; - contentType?: "application/json"; + contentType?: \\"application/json\\"; body?: Type; } - | { status: 415; contentType: "text/plain"; body: string } + | { status: 415; contentType: \\"text/plain\\"; body: string } | void; " `; diff --git a/test/typescript-generator/__snapshots__/parameters-type-coder.test.js.snap b/test/typescript-generator/__snapshots__/parameters-type-coder.test.js.snap index 0cfd8796..c5a4bd49 100644 --- a/test/typescript-generator/__snapshots__/parameters-type-coder.test.js.snap +++ b/test/typescript-generator/__snapshots__/parameters-type-coder.test.js.snap @@ -6,7 +6,7 @@ exports[`a ParametersTypeCoder generates type never when there is no match 1`] = `; exports[`a ParametersTypeCoder generates types for parameters (OAS2): header 1`] = ` -"type TestType = { "name?": string }; +"type TestType = { \\"name?\\": string }; " `; @@ -16,12 +16,12 @@ exports[`a ParametersTypeCoder generates types for parameters (OAS2): path 1`] = `; exports[`a ParametersTypeCoder generates types for parameters (OAS2): query 1`] = ` -"type TestType = { "name?": string; "age?": string }; +"type TestType = { \\"name?\\": string; \\"age?\\": string }; " `; exports[`a ParametersTypeCoder generates types for parameters: header 1`] = ` -"type TestType = { "name?": string }; +"type TestType = { \\"name?\\": string }; " `; @@ -31,6 +31,6 @@ exports[`a ParametersTypeCoder generates types for parameters: path 1`] = ` `; exports[`a ParametersTypeCoder generates types for parameters: query 1`] = ` -"type TestType = { "name?": string; "age?": string }; +"type TestType = { \\"name?\\": string; \\"age?\\": string }; " `;