mirror of
https://github.com/honojs/hono.git
synced 2024-11-24 11:07:29 +01:00
chore(test): migrate to vitest v2 (#3326)
* migrate vitest v2 * re run bun i
This commit is contained in:
parent
e449c95ed1
commit
18f937d3be
@ -617,7 +617,7 @@
|
||||
"@types/jsdom": "^21.1.4",
|
||||
"@types/node": "20.11.4",
|
||||
"@types/supertest": "^2.0.12",
|
||||
"@vitest/coverage-v8": "^1.1.0",
|
||||
"@vitest/coverage-v8": "^2.0.5",
|
||||
"arg": "^5.0.2",
|
||||
"crypto-js": "^4.1.1",
|
||||
"esbuild": "^0.15.12",
|
||||
@ -631,7 +631,7 @@
|
||||
"supertest": "^6.3.3",
|
||||
"typescript": "^5.3.3",
|
||||
"vite-plugin-fastly-js-compute": "^0.4.2",
|
||||
"vitest": "^1.2.2",
|
||||
"vitest": "^2.0.5",
|
||||
"wrangler": "^3.58.0",
|
||||
"ws": "^8.17.0",
|
||||
"zod": "^3.20.2"
|
||||
|
@ -216,7 +216,7 @@ describe('toSSG function', () => {
|
||||
writeFile: vi.fn(() => Promise.resolve()),
|
||||
mkdir: vi.fn(() => Promise.resolve()),
|
||||
}
|
||||
const afterGenerateHookMock: AfterGenerateHook = vi.fn((result) => {
|
||||
const afterGenerateHookMock: AfterGenerateHook = vi.fn<AfterGenerateHook>((result) => {
|
||||
if (result.files) {
|
||||
result.files.forEach((file) => console.log(file))
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import type { Suite } from 'vitest'
|
||||
import type { ParamIndexMap, Params, Router } from '../router'
|
||||
|
||||
const getSuiteHierarchy = (suite: Suite) => {
|
||||
const getSuiteHierarchy = (suite?: Suite) => {
|
||||
const res: Suite[] = []
|
||||
let s: Suite | undefined = suite
|
||||
while (s) {
|
||||
@ -28,7 +28,7 @@ export const runTest = ({
|
||||
|
||||
beforeEach(({ task, skip: skipTask }) => {
|
||||
const suites = getSuiteHierarchy(task.suite)
|
||||
const name = [...suites.slice(3).map((s) => s.name), task.name].join(' > ')
|
||||
const name = [...suites.slice(2).map((s) => s.name), task.name].join(' > ')
|
||||
const isSkip = skip.find((s) => s.tests.includes(name))
|
||||
if (isSkip) {
|
||||
console.log(`Skip: ${isSkip.reason}`)
|
||||
|
Loading…
Reference in New Issue
Block a user