Skip to content

Commit 9e5696a

Browse files
committed
chore(test): update to vitest 3
1 parent 729488e commit 9e5696a

File tree

41 files changed

+2546
-2979
lines changed

Some content is hidden

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

41 files changed

+2546
-2979
lines changed

examples/openapi-ts-axios/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@
2424
"@hey-api/openapi-ts": "workspace:*",
2525
"@types/react": "19.0.1",
2626
"@types/react-dom": "19.0.1",
27-
"@typescript-eslint/eslint-plugin": "7.18.0",
28-
"@typescript-eslint/parser": "7.15.0",
29-
"@vitejs/plugin-react": "4.3.1",
27+
"@typescript-eslint/eslint-plugin": "8.29.1",
28+
"@typescript-eslint/parser": "8.29.1",
29+
"@vitejs/plugin-react": "4.4.0-beta.1",
3030
"autoprefixer": "10.4.19",
3131
"eslint": "9.17.0",
32-
"eslint-plugin-react-hooks": "4.6.2",
32+
"eslint-plugin-react-hooks": "5.2.0",
3333
"eslint-plugin-react-refresh": "0.4.7",
3434
"postcss": "8.4.41",
3535
"prettier": "3.4.2",
3636
"tailwindcss": "3.4.9",
37-
"typescript": "5.5.3",
38-
"vite": "6.0.13"
37+
"typescript": "5.8.3",
38+
"vite": "6.2.6"
3939
}
4040
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"openapi": "3.1.0",
3+
"info": {
4+
"title": "Petstore API",
5+
"version": "1.0.0",
6+
"description": "A sample API that uses a petstore as an example"
7+
},
8+
"servers": [
9+
{
10+
"url": "http://localhost:3000/v3"
11+
}
12+
],
13+
"paths": {
14+
"/pets/{petId}": {
15+
"get": {
16+
"summary": "Find pet by ID",
17+
"operationId": "showPetById",
18+
"parameters": [
19+
{
20+
"name": "petId",
21+
"in": "path",
22+
"required": true,
23+
"schema": {
24+
"type": "string"
25+
}
26+
}
27+
],
28+
"responses": {
29+
"200": {
30+
"description": "Pet found",
31+
"content": {
32+
"application/json": {
33+
"schema": {
34+
"type": "object",
35+
"properties": {
36+
"id": {
37+
"type": "string"
38+
},
39+
"name": {
40+
"type": "string"
41+
}
42+
}
43+
}
44+
}
45+
}
46+
}
47+
}
48+
}
49+
},
50+
"/pets": {
51+
"get": {
52+
"summary": "List all pets",
53+
"operationId": "listPets",
54+
"responses": {
55+
"200": {
56+
"description": "A list of pets",
57+
"content": {
58+
"application/json": {
59+
"schema": {
60+
"type": "array",
61+
"items": {
62+
"type": "object",
63+
"properties": {
64+
"id": {
65+
"type": "string"
66+
},
67+
"name": {
68+
"type": "string"
69+
}
70+
}
71+
}
72+
}
73+
}
74+
}
75+
}
76+
}
77+
},
78+
"post": {
79+
"summary": "Create a pet",
80+
"operationId": "createPets",
81+
"responses": {
82+
"201": {
83+
"description": "Pet created"
84+
}
85+
}
86+
}
87+
}
88+
}
89+
}

examples/openapi-ts-fastify/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"@hey-api/openapi-ts": "workspace:*",
1818
"eslint": "9.17.0",
1919
"prettier": "3.4.2",
20-
"typescript": "5.5.3",
21-
"vitest": "1.6.0"
20+
"typescript": "5.8.3",
21+
"vite": "6.2.6",
22+
"vitest": "3.1.1"
2223
}
2324
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { buildServer } from './server';
22

3-
const fastify = buildServer();
4-
5-
fastify.listen({ port: 3000 }, function (err) {
6-
if (err) {
7-
fastify.log.error(err);
8-
process.exit(1);
9-
}
3+
buildServer().then((fastify) => {
4+
fastify.listen({ port: 3000 }, function (err) {
5+
if (err) {
6+
fastify.log.error(err);
7+
process.exit(1);
8+
}
9+
});
1010
});

examples/openapi-ts-fastify/src/server.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import Fastify from 'fastify';
22
import glue from 'fastify-openapi-glue';
3+
import { readFileSync } from 'fs';
4+
import { join } from 'path';
35

46
import { serviceHandlers } from './handlers';
57

6-
export const buildServer = () => {
8+
export const buildServer = async () => {
79
const fastify = Fastify();
810

9-
const specification = fetch(
10-
'https://gist.githubusercontent.com/seriousme/55bd4c8ba2e598e416bb5543dcd362dc/raw/cf0b86ba37bb54bf1a6bf047c0ecf2a0ce4c62e0/petstore-v3.1.json',
11-
)
12-
.then((reply) => reply.json())
13-
.then((data) => data);
14-
console.log(specification);
11+
const specificationPath = join(__dirname, '..', 'openapi.json');
12+
const specificationJson = JSON.parse(
13+
readFileSync(specificationPath, 'utf-8'),
14+
);
1515

1616
fastify.register(glue, {
1717
prefix: 'v3',
1818
serviceHandlers,
19-
specification,
19+
specification: specificationJson,
2020
});
2121

2222
return fastify;

examples/openapi-ts-fastify/test/pets.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('/pet/findByTags', () => {
88
let server: FastifyInstance;
99

1010
beforeAll(async () => {
11-
server = buildServer();
11+
server = await buildServer();
1212
await server.listen();
1313

1414
// @ts-ignore

examples/openapi-ts-fastify/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
"esModuleInterop": true,
1010
"skipLibCheck": true,
1111
"baseUrl": "."
12-
}
12+
},
13+
"references": [{ "path": "./tsconfig.node.json" }]
1314
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"skipLibCheck": true,
5+
"module": "ESNext",
6+
"moduleResolution": "bundler",
7+
"allowSyntheticDefaultImports": true,
8+
"strict": true
9+
},
10+
"include": ["vite.config.ts"]
11+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from 'vitest/config';
2+
3+
// https://vitejs.dev/config/
4+
export default defineConfig({
5+
plugins: [],
6+
test: {
7+
environment: 'node',
8+
globals: true,
9+
include: ['test/**/*.test.ts'],
10+
watch: false,
11+
},
12+
});

examples/openapi-ts-fetch/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@
2323
"@hey-api/openapi-ts": "workspace:*",
2424
"@types/react": "19.0.1",
2525
"@types/react-dom": "19.0.1",
26-
"@typescript-eslint/eslint-plugin": "7.18.0",
27-
"@typescript-eslint/parser": "7.15.0",
28-
"@vitejs/plugin-react": "4.3.1",
26+
"@typescript-eslint/eslint-plugin": "8.29.1",
27+
"@typescript-eslint/parser": "8.29.1",
28+
"@vitejs/plugin-react": "4.4.0-beta.1",
2929
"autoprefixer": "10.4.19",
3030
"eslint": "9.17.0",
31-
"eslint-plugin-react-hooks": "4.6.2",
31+
"eslint-plugin-react-hooks": "5.2.0",
3232
"eslint-plugin-react-refresh": "0.4.7",
3333
"postcss": "8.4.41",
3434
"prettier": "3.4.2",
3535
"tailwindcss": "3.4.9",
36-
"typescript": "5.5.3",
37-
"vite": "6.0.13"
36+
"typescript": "5.8.3",
37+
"vite": "6.2.6"
3838
}
3939
}

examples/openapi-ts-next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
"eslint-config-next": "15.1.6",
2525
"postcss": "8.4.41",
2626
"tailwindcss": "3.4.9",
27-
"typescript": "5.5.3"
27+
"typescript": "5.8.3"
2828
}
2929
}

examples/openapi-ts-nuxt/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
"zod": "3.23.8"
2020
},
2121
"devDependencies": {
22-
"vite": "6.0.13"
22+
"vite": "6.2.6"
2323
}
2424
}

examples/openapi-ts-sample/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@
2323
"@hey-api/openapi-ts": "workspace:*",
2424
"@types/react": "19.0.1",
2525
"@types/react-dom": "19.0.1",
26-
"@typescript-eslint/eslint-plugin": "7.18.0",
27-
"@typescript-eslint/parser": "7.15.0",
28-
"@vitejs/plugin-react": "4.3.1",
26+
"@typescript-eslint/eslint-plugin": "8.29.1",
27+
"@typescript-eslint/parser": "8.29.1",
28+
"@vitejs/plugin-react": "4.4.0-beta.1",
2929
"autoprefixer": "10.4.19",
3030
"eslint": "9.17.0",
31-
"eslint-plugin-react-hooks": "4.6.2",
31+
"eslint-plugin-react-hooks": "5.2.0",
3232
"eslint-plugin-react-refresh": "0.4.7",
3333
"postcss": "8.4.41",
3434
"prettier": "3.4.2",
3535
"tailwindcss": "3.4.9",
36-
"typescript": "5.5.3",
37-
"vite": "6.0.13"
36+
"typescript": "5.8.3",
37+
"vite": "6.2.6"
3838
}
3939
}

examples/openapi-ts-tanstack-angular-query-experimental/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@angular/platform-browser-dynamic": "^19.2.0",
2323
"@angular/router": "^19.2.0",
2424
"@hey-api/client-fetch": "workspace:*",
25-
"@tanstack/angular-query-experimental": "5.62.13",
25+
"@tanstack/angular-query-experimental": "5.73.3",
2626
"rxjs": "~7.8.0",
2727
"tslib": "^2.8.1",
2828
"zone.js": "~0.15.0"
@@ -39,6 +39,6 @@
3939
"karma-coverage": "~2.2.0",
4040
"karma-jasmine": "~5.1.0",
4141
"karma-jasmine-html-reporter": "~2.1.0",
42-
"typescript": "5.5.3"
42+
"typescript": "5.8.3"
4343
}
4444
}

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@
1616
"@radix-ui/react-form": "0.1.1",
1717
"@radix-ui/react-icons": "1.3.2",
1818
"@radix-ui/themes": "3.1.6",
19-
"@tanstack/react-query": "5.62.15",
20-
"@tanstack/react-query-devtools": "5.62.15",
19+
"@tanstack/react-query": "5.73.3",
20+
"@tanstack/react-query-devtools": "5.73.3",
2121
"react": "19.0.0",
2222
"react-dom": "19.0.0"
2323
},
2424
"devDependencies": {
2525
"@hey-api/openapi-ts": "workspace:*",
2626
"@types/react": "19.0.1",
2727
"@types/react-dom": "19.0.1",
28-
"@typescript-eslint/eslint-plugin": "7.18.0",
29-
"@typescript-eslint/parser": "7.15.0",
30-
"@vitejs/plugin-react": "4.3.1",
28+
"@typescript-eslint/eslint-plugin": "8.29.1",
29+
"@typescript-eslint/parser": "8.29.1",
30+
"@vitejs/plugin-react": "4.4.0-beta.1",
3131
"autoprefixer": "10.4.19",
3232
"eslint": "9.17.0",
33-
"eslint-plugin-react-hooks": "4.6.2",
33+
"eslint-plugin-react-hooks": "5.2.0",
3434
"eslint-plugin-react-refresh": "0.4.7",
3535
"postcss": "8.4.41",
3636
"prettier": "3.4.2",
3737
"tailwindcss": "3.4.9",
38-
"typescript": "5.5.3",
39-
"vite": "6.0.13"
38+
"typescript": "5.8.3",
39+
"vite": "6.2.6"
4040
}
4141
}

examples/openapi-ts-tanstack-svelte-query/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"dependencies": {
1919
"@hey-api/client-fetch": "workspace:*",
20-
"@tanstack/svelte-query": "5.62.12"
20+
"@tanstack/svelte-query": "5.73.3"
2121
},
2222
"devDependencies": {
2323
"@fontsource/fira-mono": "5.0.0",
@@ -35,9 +35,9 @@
3535
"prettier-plugin-svelte": "3.1.2",
3636
"svelte": "5.19.9",
3737
"svelte-check": "4.1.4",
38-
"typescript": "5.5.3",
39-
"typescript-eslint": "8.19.1",
40-
"vite": "6.0.13",
41-
"vitest": "1.6.0"
38+
"typescript": "5.8.3",
39+
"typescript-eslint": "8.29.1",
40+
"vite": "6.2.6",
41+
"vitest": "3.1.1"
4242
}
4343
}

examples/openapi-ts-tanstack-vue-query/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
},
1717
"dependencies": {
1818
"@hey-api/client-fetch": "workspace:*",
19-
"@tanstack/vue-query": "5.62.12",
20-
"@tanstack/vue-query-devtools": "5.62.12",
19+
"@tanstack/vue-query": "5.73.3",
20+
"@tanstack/vue-query-devtools": "5.73.3",
2121
"pinia": "2.3.0",
2222
"vue": "3.5.13",
2323
"vue-router": "4.5.0"
@@ -42,10 +42,10 @@
4242
"postcss": "8.4.41",
4343
"prettier": "3.4.2",
4444
"tailwindcss": "3.4.9",
45-
"typescript": "5.5.3",
46-
"vite": "6.0.13",
45+
"typescript": "5.8.3",
46+
"vite": "6.2.6",
4747
"vite-plugin-vue-devtools": "7.7.0",
48-
"vitest": "1.6.0",
48+
"vitest": "3.1.1",
4949
"vue-tsc": "2.2.0"
5050
}
5151
}

examples/openapi-ts-tanstack-vue-query/src/App.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { RouterView } from 'vue-router'
44
</script>
55

66
<template>
7-
<RouterView />
8-
9-
<VueQueryDevtools />
7+
<div>
8+
<RouterView />
9+
<VueQueryDevtools />
10+
</div>
1011
</template>

0 commit comments

Comments
 (0)