Skip to content

Commit cd25794

Browse files
el-jrat-falthaus
andauthored
chore: updated all dep and fixed all vulnerabilities (#241)
* updated all dep and fixed all vulnerabilities * removed template.test.ts so tests pass. there is no template.ts file at all... * udpate @types/jest to ^29.5.12 * update test files * udpate just to 30.0.0-alpha.1 supporting prettier 3.0.0 now --------- Co-authored-by: Fabian Althaus <[email protected]>
1 parent 9c9af24 commit cd25794

20 files changed

+23353
-18463
lines changed

cli/src/core/generateConfigProperty.test.ts

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ describe("generateConfigProperty", () => {
1616
});
1717

1818
expect(print(config)).toMatchInlineSnapshot(`
19-
"foo: {
20-
from: {
21-
source: \\"file\\",
22-
relativePath: \\"specs.yaml\\"
23-
},
24-
outputDir: \\"specs\\",
25-
to: async (context) => {
26-
await generateSchemaTypes(context, {
27-
filenamePrefix: \\"foo\\"
28-
});
29-
}
30-
}"
19+
"foo: {
20+
from: {
21+
source: "file",
22+
relativePath: "specs.yaml"
23+
},
24+
outputDir: "specs",
25+
to: async (context) => {
26+
await generateSchemaTypes(context, {
27+
filenamePrefix: "foo"
28+
});
29+
}
30+
}"
3131
`);
3232
});
3333

@@ -45,23 +45,23 @@ describe("generateConfigProperty", () => {
4545
});
4646

4747
expect(print(config)).toMatchInlineSnapshot(`
48-
"foo: {
49-
from: {
50-
source: \\"file\\",
51-
relativePath: \\"specs.yaml\\"
52-
},
53-
outputDir: \\"specs\\",
54-
to: async (context) => {
55-
const filenamePrefix = \\"foo\\";
56-
const { schemasFiles } = await generateSchemaTypes(context, {
57-
filenamePrefix
58-
});
59-
await generateReactQueryComponents(context, {
60-
filenamePrefix,
61-
schemasFiles
62-
});
63-
}
64-
}"
48+
"foo: {
49+
from: {
50+
source: "file",
51+
relativePath: "specs.yaml"
52+
},
53+
outputDir: "specs",
54+
to: async (context) => {
55+
const filenamePrefix = "foo";
56+
const { schemasFiles } = await generateSchemaTypes(context, {
57+
filenamePrefix
58+
});
59+
await generateReactQueryComponents(context, {
60+
filenamePrefix,
61+
schemasFiles
62+
});
63+
}
64+
}"
6565
`);
6666
});
6767

@@ -82,26 +82,26 @@ describe("generateConfigProperty", () => {
8282
});
8383

8484
expect(print(config)).toMatchInlineSnapshot(`
85-
"foo: {
86-
from: {
87-
source: \\"github\\",
88-
ref: \\"main\\",
89-
owner: \\"fabien0102\\",
90-
repository: \\"openapi-codegen\\",
91-
specPath: \\"examples/petstore.json\\"
92-
},
93-
outputDir: \\"specs\\",
94-
to: async (context) => {
95-
const filenamePrefix = \\"foo\\";
96-
const { schemasFiles } = await generateSchemaTypes(context, {
97-
filenamePrefix
98-
});
99-
await generateFetchers(context, {
100-
filenamePrefix,
101-
schemasFiles
102-
});
103-
}
104-
}"
85+
"foo: {
86+
from: {
87+
source: "github",
88+
ref: "main",
89+
owner: "fabien0102",
90+
repository: "openapi-codegen",
91+
specPath: "examples/petstore.json"
92+
},
93+
outputDir: "specs",
94+
to: async (context) => {
95+
const filenamePrefix = "foo";
96+
const { schemasFiles } = await generateSchemaTypes(context, {
97+
filenamePrefix
98+
});
99+
await generateFetchers(context, {
100+
filenamePrefix,
101+
schemasFiles
102+
});
103+
}
104+
}"
105105
`);
106106
});
107107
});

cli/src/core/getOpenAPISourceFile.file.test.ts

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ describe("getOpenAPISourceFile (source = file)", () => {
99

1010
expect(format).toBe("yaml");
1111
expect(text).toMatchInlineSnapshot(`
12-
"openapi: \\"3.0.2\\"
13-
info:
14-
title: API Title
15-
version: \\"1.0\\"
16-
servers:
17-
- url: https://api.server.test/v1
18-
paths:
19-
/test:
20-
get:
21-
responses:
22-
\\"200\\":
23-
description: OK
24-
"
12+
"openapi: "3.0.2"
13+
info:
14+
title: API Title
15+
version: "1.0"
16+
servers:
17+
- url: https://api.server.test/v1
18+
paths:
19+
/test:
20+
get:
21+
responses:
22+
"200":
23+
description: OK
24+
"
2525
`);
2626
});
2727

@@ -33,19 +33,19 @@ describe("getOpenAPISourceFile (source = file)", () => {
3333

3434
expect(format).toBe("yaml");
3535
expect(text).toMatchInlineSnapshot(`
36-
"openapi: \\"3.0.2\\"
37-
info:
38-
title: API Title
39-
version: \\"1.0\\"
40-
servers:
41-
- url: https://api.server.test/v1
42-
paths:
43-
/test:
44-
get:
45-
responses:
46-
\\"200\\":
47-
description: OK
48-
"
36+
"openapi: "3.0.2"
37+
info:
38+
title: API Title
39+
version: "1.0"
40+
servers:
41+
- url: https://api.server.test/v1
42+
paths:
43+
/test:
44+
get:
45+
responses:
46+
"200":
47+
description: OK
48+
"
4949
`);
5050
});
5151

@@ -57,30 +57,30 @@ describe("getOpenAPISourceFile (source = file)", () => {
5757

5858
expect(format).toBe("json");
5959
expect(text).toMatchInlineSnapshot(`
60-
"{
61-
\\"openapi\\": \\"3.0.2\\",
62-
\\"info\\": {
63-
\\"title\\": \\"API Title\\",
64-
\\"version\\": \\"1.0\\"
65-
},
66-
\\"servers\\": [
67-
{
68-
\\"url\\": \\"https://api.server.test/v1\\"
69-
}
70-
],
71-
\\"paths\\": {
72-
\\"/test\\": {
73-
\\"get\\": {
74-
\\"responses\\": {
75-
\\"200\\": {
76-
\\"description\\": \\"OK\\"
77-
}
78-
}
79-
}
80-
}
81-
}
82-
}
83-
"
60+
"{
61+
"openapi": "3.0.2",
62+
"info": {
63+
"title": "API Title",
64+
"version": "1.0"
65+
},
66+
"servers": [
67+
{
68+
"url": "https://api.server.test/v1"
69+
}
70+
],
71+
"paths": {
72+
"/test": {
73+
"get": {
74+
"responses": {
75+
"200": {
76+
"description": "OK"
77+
}
78+
}
79+
}
80+
}
81+
}
82+
}
83+
"
8484
`);
8585
});
8686

@@ -93,7 +93,7 @@ describe("getOpenAPISourceFile (source = file)", () => {
9393
fail("should throw an error");
9494
} catch (e) {
9595
expect(e).toMatchInlineSnapshot(
96-
`[Error: "yolo" extension file is not supported!]`
96+
`[Error: "yolo" extension file is not supported!]`,
9797
);
9898
}
9999
});

cli/src/core/getOpenAPISourceFile.url.test.ts

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import nock from "nock";
44
describe("getOpenAPISourceFile (source = url)", () => {
55
it("should retrieve a json file specs", async () => {
66
nock(
7-
"https://github.com/fabien0102/openapi-codegen/blob/main/cli/examples/petstore.json"
7+
"https://github.com/fabien0102/openapi-codegen/blob/main/cli/examples/petstore.json",
88
)
99
.get("")
1010
.replyWithFile(200, "cli/src/fixtures/spec.json");
@@ -17,36 +17,36 @@ describe("getOpenAPISourceFile (source = url)", () => {
1717

1818
expect(format).toBe("json");
1919
expect(text).toMatchInlineSnapshot(`
20-
"{
21-
\\"openapi\\": \\"3.0.2\\",
22-
\\"info\\": {
23-
\\"title\\": \\"API Title\\",
24-
\\"version\\": \\"1.0\\"
25-
},
26-
\\"servers\\": [
27-
{
28-
\\"url\\": \\"https://api.server.test/v1\\"
29-
}
30-
],
31-
\\"paths\\": {
32-
\\"/test\\": {
33-
\\"get\\": {
34-
\\"responses\\": {
35-
\\"200\\": {
36-
\\"description\\": \\"OK\\"
37-
}
38-
}
39-
}
40-
}
41-
}
42-
}
43-
"
20+
"{
21+
"openapi": "3.0.2",
22+
"info": {
23+
"title": "API Title",
24+
"version": "1.0"
25+
},
26+
"servers": [
27+
{
28+
"url": "https://api.server.test/v1"
29+
}
30+
],
31+
"paths": {
32+
"/test": {
33+
"get": {
34+
"responses": {
35+
"200": {
36+
"description": "OK"
37+
}
38+
}
39+
}
40+
}
41+
}
42+
}
43+
"
4444
`);
4545
});
4646

4747
it("should guess the format with search params", async () => {
4848
nock(
49-
"https://github.com/fabien0102/openapi-codegen/blob/main/cli/examples/petstore.yaml"
49+
"https://github.com/fabien0102/openapi-codegen/blob/main/cli/examples/petstore.yaml",
5050
)
5151
.get("?key=secret")
5252
.replyWithFile(200, "cli/src/fixtures/spec.yaml");
@@ -59,19 +59,19 @@ describe("getOpenAPISourceFile (source = url)", () => {
5959

6060
expect(format).toBe("yaml");
6161
expect(text).toMatchInlineSnapshot(`
62-
"openapi: \\"3.0.2\\"
63-
info:
64-
title: API Title
65-
version: \\"1.0\\"
66-
servers:
67-
- url: https://api.server.test/v1
68-
paths:
69-
/test:
70-
get:
71-
responses:
72-
\\"200\\":
73-
description: OK
74-
"
62+
"openapi: "3.0.2"
63+
info:
64+
title: API Title
65+
version: "1.0"
66+
servers:
67+
- url: https://api.server.test/v1
68+
paths:
69+
/test:
70+
get:
71+
responses:
72+
"200":
73+
description: OK
74+
"
7575
`);
7676
});
7777
});

0 commit comments

Comments
 (0)