Skip to content

Commit 93f0c42

Browse files
authored
chore: update deps, update tests (#840)
1 parent 27d5197 commit 93f0c42

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+49236
-28240
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.cache
22
.DS_Store
33
**/generated/
4+
**/__snapshots__/
45
coverage
56
dist
67
node_modules

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ This should update the expected TypeScript definiton.
5858
5959
_Also if this appears in `examples/` feel free to update that, too!_
6060
61+
## Testing
62+
63+
Tests can be run with `npm test`. This will build the library first to ensure you’re not testing a stale build.
64+
6165
## Help needed
6266
6367
Please check out the [the open issues][issues]. Issues labelled [**Help Wanted**][help-wanted] and [**Good First

examples/stripe-openapi2.ts

Lines changed: 4089 additions & 3221 deletions
Large diffs are not rendered by default.

examples/stripe-openapi3.ts

Lines changed: 4642 additions & 3283 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 138 additions & 477 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
"js-yaml": "^4.1.0",
6363
"kleur": "^4.1.4",
6464
"meow": "^9.0.0",
65-
"mime": "^2.5.2",
66-
"node-fetch": "^2.6.5",
67-
"prettier": "^2.4.1",
65+
"mime": "^3.0.0",
66+
"node-fetch": "^2.6.6",
67+
"prettier": "^2.5.1",
6868
"slash": "^3.0.0",
6969
"tiny-glob": "^0.2.9"
7070
},
@@ -73,14 +73,15 @@
7373
"@types/js-yaml": "^4.0.1",
7474
"@types/mime": "^2.0.3",
7575
"@types/node-fetch": "^2.5.12",
76-
"@typescript-eslint/eslint-plugin": "^5.0.0",
77-
"@typescript-eslint/parser": "^5.0.0",
76+
"@typescript-eslint/eslint-plugin": "^5.8.0",
77+
"@typescript-eslint/parser": "^5.8.0",
7878
"codecov": "^3.8.2",
79-
"eslint": "^8.0.1",
79+
"eol": "^0.9.1",
80+
"eslint": "^8.5.0",
8081
"eslint-config-prettier": "^8.3.0",
8182
"eslint-plugin-prettier": "^4.0.0",
82-
"jest": "^27.2.5",
83-
"ts-jest": "^27.0.5",
83+
"jest": "^27.4.5",
84+
"ts-jest": "^27.1.2",
8485
"typescript": "^4.4.3"
8586
}
8687
}

tests/__snapshots__/empty-definitions.test.ts.snap

Lines changed: 0 additions & 63 deletions
This file was deleted.

tests/__snapshots__/formatter.test.ts.snap

Lines changed: 0 additions & 45 deletions
This file was deleted.

tests/bin/cli.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ describe("cli", () => {
4343
execSync(`${cmd} "specs/*.yaml" -o generated/`, { cwd }); // Quotes are necessary because shells like zsh treats glob weirdly
4444
const [generatedPetstore, expectedPetstore, generatedManifold, expectedManifold] = await Promise.all([
4545
fs.promises.readFile(path.join(__dirname, "generated", "specs", "petstore.ts"), "utf8"),
46-
fs.promises.readFile(path.join(__dirname, "expected", "petstore.ts"), "utf8"),
46+
fs.promises.readFile(path.join(__dirname, "expected", "specs", "petstore.ts"), "utf8"),
4747
fs.promises.readFile(path.join(__dirname, "generated", "specs", "manifold.ts"), "utf8"),
48-
fs.promises.readFile(path.join(__dirname, "expected", "manifold.ts"), "utf8"),
48+
fs.promises.readFile(path.join(__dirname, "expected", "specs", "manifold.ts"), "utf8"),
4949
]);
5050
expect(generatedPetstore).toBe(sanitizeLB(expectedPetstore));
5151
expect(generatedManifold).toBe(sanitizeLB(expectedManifold));

tests/bin/expected/prettier-js.ts

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,43 +66,56 @@ export interface paths {
6666
export interface components {
6767
schemas: {
6868
Order: {
69+
/** Format: int64 */
6970
id?: number
71+
/** Format: int64 */
7072
petId?: number
73+
/** Format: int32 */
7174
quantity?: number
75+
/** Format: date-time */
7276
shipDate?: string
73-
/** Order Status */
77+
/** @description Order Status */
7478
status?: 'placed' | 'approved' | 'delivered'
7579
complete?: boolean
7680
}
7781
Category: {
82+
/** Format: int64 */
7883
id?: number
7984
name?: string
8085
}
8186
User: {
87+
/** Format: int64 */
8288
id?: number
8389
username?: string
8490
firstName?: string
8591
lastName?: string
8692
email?: string
8793
password?: string
8894
phone?: string
89-
/** User Status */
95+
/**
96+
* Format: int32
97+
* @description User Status
98+
*/
9099
userStatus?: number
91100
}
92101
Tag: {
102+
/** Format: int64 */
93103
id?: number
94104
name?: string
95105
}
96106
Pet: {
107+
/** Format: int64 */
97108
id?: number
98109
category?: components['schemas']['Category']
110+
/** @example doggie */
99111
name: string
100112
photoUrls: string[]
101113
tags?: components['schemas']['Tag'][]
102-
/** pet status in the store */
114+
/** @description pet status in the store */
103115
status?: 'available' | 'pending' | 'sold'
104116
}
105117
ApiResponse: {
118+
/** Format: int32 */
106119
code?: number
107120
type?: string
108121
message?: string
@@ -217,9 +230,9 @@ export interface operations {
217230
requestBody: {
218231
content: {
219232
'application/x-www-form-urlencoded': {
220-
/** Updated name of the pet */
233+
/** @description Updated name of the pet */
221234
name?: string
222-
/** Updated status of the pet */
235+
/** @description Updated status of the pet */
223236
status?: string
224237
}
225238
}
@@ -260,9 +273,12 @@ export interface operations {
260273
requestBody: {
261274
content: {
262275
'multipart/form-data': {
263-
/** Additional data to pass to server */
276+
/** @description Additional data to pass to server */
264277
additionalMetadata?: string
265-
/** file to upload */
278+
/**
279+
* Format: binary
280+
* @description file to upload
281+
*/
266282
file?: string
267283
}
268284
}

0 commit comments

Comments
 (0)