Skip to content

Commit cfc0abb

Browse files
author
Lubos ​
committed
chore: fix tests
1 parent 29605a0 commit cfc0abb

File tree

54 files changed

+1571
-111
lines changed

Some content is hidden

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

54 files changed

+1571
-111
lines changed

.changeset/famous-penguins-repair.md

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

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ test/e2e/generated
2424

2525
# error files
2626
openapi-ts-error-*
27+
28+
# But DO NOT ignore generated snapshots!
29+
!test/__snapshots__/test/generated
30+
!test/__snapshots__/test/generated/**

examples/openapi-ts-axios/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/* Linting */
1818
"strict": true,
1919
"noUnusedLocals": true,
20-
"noUnusedParameters": true,
20+
"noUnusedParameters": false,
2121
"noFallthroughCasesInSwitch": true
2222
},
2323
"include": ["src"],

examples/openapi-ts-fastify/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"include": ["src/**/*", "test/**/*"],
33
"compilerOptions": {
4-
"lib": ["es2023"],
4+
"lib": ["es2023", "dom", "dom.iterable"],
55
"target": "es2022",
66
"module": "ESNext",
77
"moduleResolution": "Bundler",

examples/openapi-ts-fetch/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/* Linting */
1818
"strict": true,
1919
"noUnusedLocals": true,
20-
"noUnusedParameters": true,
20+
"noUnusedParameters": false,
2121
"noFallthroughCasesInSwitch": true
2222
},
2323
"include": ["src"],

examples/openapi-ts-tanstack-react-query/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/* Linting */
1818
"strict": true,
1919
"noUnusedLocals": true,
20-
"noUnusedParameters": true,
20+
"noUnusedParameters": false,
2121
"noFallthroughCasesInSwitch": true
2222
},
2323
"include": ["src"],

examples/openapi-ts-tanstack-vue-query/src/views/TanstackExample.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts" setup>
22
import type { Pet } from '@/client'
3-
import { createClient } from '@client/client'
3+
import { createClient } from '@/client/client'
44
import { PetSchema } from '@/client/schemas.gen'
55
import {
66
addPetMutation,
@@ -9,6 +9,7 @@ import {
99
} from '@/client/@tanstack/vue-query.gen'
1010
import { useMutation, useQuery, useQueryClient } from '@tanstack/vue-query'
1111
import { computed, ref, watch } from 'vue'
12+
import type { RequestOptions } from '@/client/client'
1213
1314
const queryClient = useQueryClient()
1415
@@ -25,7 +26,7 @@ const localClient = createClient({
2526
}
2627
})
2728
28-
localClient.interceptors.request.use((request, options) => {
29+
localClient.interceptors.request.use((request: Request, options: RequestOptions) => {
2930
// Middleware is great for adding authorization tokens to requests made to
3031
// protected paths. Headers are set randomly here to allow surfacing the
3132
// default headers, too.

packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/client.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This file is auto-generated by @hey-api/openapi-ts
22

33
import type { ClientOptions } from './types.gen.js';
4-
import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client.js';
4+
import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client/index.js';
55

66
/**
77
* The `createClientConfig()` function will be called on client initialization

packages/openapi-ts-tests/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/client/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import type { AxiosError, RawAxiosRequestHeaders } from 'axios';
22
import axios from 'axios';
33

4-
import type { Client, Config } from './types';
4+
import type { Client, Config } from './types.js';
55
import {
66
buildUrl,
77
createConfig,
88
mergeConfigs,
99
mergeHeaders,
1010
setAuthParams,
11-
} from './utils';
11+
} from './utils.js';
1212

1313
export const createClient = (config: Config = {}): Client => {
1414
let _config = mergeConfigs(createConfig(), config);
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
export type { Auth } from '../core/auth';
2-
export type { QuerySerializerOptions } from '../core/bodySerializer';
1+
export type { Auth } from '../core/auth.js';
2+
export type { QuerySerializerOptions } from '../core/bodySerializer.js';
33
export {
44
formDataBodySerializer,
55
jsonBodySerializer,
66
urlSearchParamsBodySerializer,
7-
} from '../core/bodySerializer';
8-
export { buildClientParams } from '../core/params';
9-
export { createClient } from './client';
7+
} from '../core/bodySerializer.js';
8+
export { buildClientParams } from '../core/params.js';
9+
export { createClient } from './client.js';
1010
export type {
1111
Client,
1212
ClientOptions,
@@ -17,5 +17,5 @@ export type {
1717
RequestOptions,
1818
RequestResult,
1919
TDataShape,
20-
} from './types';
21-
export { createConfig } from './utils';
20+
} from './types.js';
21+
export { createConfig } from './utils.js';

0 commit comments

Comments
 (0)