Skip to content

Commit e516700

Browse files
committed
feat(vitest): move to vitest from jest
BREAKING CHANGE: vitest is now the default test runner
1 parent e8107af commit e516700

File tree

7 files changed

+774
-1044
lines changed

7 files changed

+774
-1044
lines changed

coconfig.cjs

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

package.json

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Max Metral <[email protected]>",
1414
"license": "MIT",
1515
"config": {
16-
"coconfig": "./coconfig.cjs"
16+
"coconfig": "@openapi-typescript-infra/coconfig"
1717
},
1818
"scripts": {
1919
"build": "tsc -p tsconfig.build.json",
@@ -37,28 +37,27 @@
3737
"*.{js,jsx,ts,tsx}": "yarn eslint src --cache --fix"
3838
},
3939
"devDependencies": {
40-
"@commitlint/cli": "^17.6.6",
41-
"@commitlint/config-conventional": "^17.6.6",
42-
"@openapi-typescript-infra/coconfig": "^3.2.0",
40+
"@commitlint/cli": "^17.7.1",
41+
"@commitlint/config-conventional": "^17.7.0",
42+
"@openapi-typescript-infra/coconfig": "^4.2.0",
4343
"@types/configstore": "^6.0.0",
44-
"@types/handlebars-helpers": "^0.5.3",
44+
"@types/handlebars-helpers": "^0.5.4",
4545
"@types/minimist": "^1.2.2",
46-
"@types/node": "^20.4.2",
46+
"@types/node": "^20.6.2",
4747
"@types/parse-git-config": "^3.0.1",
4848
"@types/pascalcase": "^1.0.1",
49-
"@typescript-eslint/eslint-plugin": "^6.1.0",
50-
"@typescript-eslint/parser": "^6.1.0",
51-
"coconfig": "^0.12.2",
52-
"eslint": "^8.45.0",
53-
"eslint-config-prettier": "^8.8.0",
54-
"eslint-import-resolver-typescript": "^3.5.5",
55-
"eslint-plugin-import": "^2.27.5",
56-
"eslint-plugin-jest": "^27.2.3",
49+
"@typescript-eslint/eslint-plugin": "^6.7.2",
50+
"@typescript-eslint/parser": "^6.7.2",
51+
"coconfig": "^0.13.3",
52+
"eslint": "^8.49.0",
53+
"eslint-config-prettier": "^9.0.0",
54+
"eslint-import-resolver-typescript": "^3.6.0",
55+
"eslint-plugin-import": "^2.28.1",
5756
"husky": "^8.0.3",
58-
"lint-staged": "^13.2.3",
57+
"lint-staged": "^14.0.1",
5958
"pinst": "^3.0.0",
60-
"prettier": "^3.0.0",
61-
"typescript": "^5.1.6"
59+
"prettier": "^3.0.3",
60+
"typescript": "^5.2.2"
6261
},
6362
"packageManager": "[email protected]",
6463
"dependencies": {
@@ -70,7 +69,7 @@
7069
"mkdirp": "^3.0.1",
7170
"openapi-types": "^12.1.3",
7271
"parse-git-config": "^3.0.0",
73-
"plop": "^3.1.2",
72+
"plop": "^4.0.0",
7473
"plop-pack-git-init": "^0.3.1"
7574
}
7675
}

src/dependencies.ts

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ function sortByKey(deps: Record<string, string>) {
99

1010
export function dependencies({ features }: { features: string[] }) {
1111
const deps = {
12-
'@openapi-typescript-infra/coconfig': '^3.2.0',
13-
'@openapi-typescript-infra/service': '^1.1.3',
12+
'@openapi-typescript-infra/coconfig': '^4.1.0',
13+
'@openapi-typescript-infra/service': '^2.7.1',
1414
} as Record<string, string>;
1515
if (features.includes('db')) {
1616
Object.assign(deps, {
17-
kysely: '^0.24.2',
18-
pg: '^8.11.0',
17+
kysely: '^0.26.3',
18+
pg: '^8.11.3',
1919
});
2020
}
2121
if (features.includes('redis')) {
@@ -28,28 +28,23 @@ export function dependencies({ features }: { features: string[] }) {
2828

2929
export function devDependencies({ features }: { features: string[] }) {
3030
const deps = {
31-
coconfig: '^0.12.2',
32-
'@openapi-typescript-infra/service-tester': '^1.0.5',
33-
'@typescript-eslint/eslint-plugin': '^6.1.0',
34-
'@typescript-eslint/parser': '^6.1.0',
35-
'@types/jest': '^29.5.3',
31+
coconfig: '^0.13.3',
32+
'@openapi-typescript-infra/service-tester': '^2.1.1',
33+
'@typescript-eslint/eslint-plugin': '^6.7.2',
34+
'@typescript-eslint/parser': '^6.7.2',
3635
eslint: '^8.45.0',
37-
'eslint-config-prettier': '^8.8.0',
38-
'eslint-plugin-cypress': '^2.13.3',
39-
'eslint-plugin-import': '^2.27.5',
40-
'eslint-plugin-jest': '^27.2.3',
41-
jest: '^29.6.1',
42-
'jest-openapi': '^0.14.2',
36+
'eslint-config-prettier': '^9.0.0',
37+
'eslint-plugin-import': '^2.28.1',
4338
'prettier': '^3.0.0',
44-
'ts-jest': '^29.1.1',
4539
typescript: '^5.1.6',
40+
vitest: '^0.34.4',
4641
};
4742
if (features.includes('db')) {
4843
Object.assign(deps, {
49-
'run-pg-sql': '^1.1.0',
50-
'db-migrate': '^0.11.13',
51-
'db-migrate-pg': '^1.3.0',
52-
'kysely-codegen': '^0.10.0',
44+
'run-pg-sql': '^1.2.0',
45+
'db-migrate': '^0.11.14',
46+
'db-migrate-pg': '^1.5.2',
47+
'kysely-codegen': '^0.10.1',
5348
});
5449
}
5550
return sortByKey(deps);

templates/all/.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"skipFiles": [
1212
"<node_internals>/**"
1313
],
14-
"program": "${workspaceFolder}/node_modules/.bin/jest",
14+
"program": "${workspaceFolder}/node_modules/.bin/vitest",
1515
"outFiles": [
1616
"${workspaceFolder}/**/*.js"
1717
]

templates/all/__tests__/index.spec.ts.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import request from 'supertest';
2-
import { getReusableApp } from '@openapi-typescript-infra/service-tester';
1+
import { describe, test } from 'vitest';
2+
import { getReusableApp, request } from '@openapi-typescript-infra/service-tester';
33

44
describe('Basic test', () => {
5-
it('make an encryption key', async () => {
5+
test('make an encryption key', async () => {
66
const app = await getReusableApp();
77

88
await request(app)

templates/all/package.json.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"main": "build/index.js",
77
"types": "build/index.d.ts",
88
"scripts": {
9-
"test": "oti-jest",
9+
"test": "vitest",
1010
"build": "make",
1111
"watch": "nodemon",
1212
"clean": "make clean",

0 commit comments

Comments
 (0)