0
0
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:
yasuaki640 2024-08-29 16:57:40 +09:00 committed by GitHub
parent e449c95ed1
commit 18f937d3be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 355 additions and 306 deletions

BIN
bun.lockb

Binary file not shown.

View File

@ -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"

View File

@ -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))
}

View 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}`)

651
yarn.lock

File diff suppressed because it is too large Load Diff