0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-24 11:07:29 +01:00

chore: upgrading vitest to v1.0 (#1830)

* update vitest

* vitest type
This commit is contained in:
watany 2023-12-19 07:29:30 +09:00 committed by GitHub
parent 76dbc74407
commit 8addfd442a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 317 additions and 538 deletions

View File

@ -450,7 +450,7 @@
"@types/node": "^20.8.2",
"@types/node-fetch": "^2.6.2",
"@types/supertest": "^2.0.12",
"@vitest/coverage-v8": "^0.34.3",
"@vitest/coverage-v8": "^1.0.4",
"arg": "^5.0.2",
"crypto-js": "^4.1.1",
"denoify": "^1.6.6",
@ -469,7 +469,7 @@
"tsx": "^3.11.0",
"typescript": "^5.3.3",
"vite-plugin-fastly-js-compute": "^0.4.2",
"vitest": "^0.34.3",
"vitest": "^1.0.4",
"wrangler": "3.17.1",
"zod": "^3.20.2"
},

View File

@ -484,22 +484,15 @@ describe('Duplicate param name', () => {
expect(res[0][0]).toBe('foo')
expect(res[0][1]).toEqual({ id: '123', action: 'action' })
})
})
it('get /posts/456', () => {
const [res] = node.search('get', '/posts/456')
expect(res.length).toBe(2)
expect(res[0][0]).toBe('foo')
expect(res[0][1]).toEqual({ id: 'posts', action: '456' })
expect(res[1][0]).toBe('bar')
expect(res[1][1]).toEqual({ id: '456' })
it('get /posts/456', () => {
const [res] = node.search('get', '/posts/abc/comments/edf')
expect(res.length).toBe(1)
expect(res[0][0]).toBe('comment')
expect(res[0][1]).toEqual({ id: 'abc', comment_id: 'edf' })
})
})
it('get /posts/456 for comments', () => {
const node = new Node()
node.insert('get', '/posts/:id/comments/:comment_id', 'comment')
const [res] = node.search('get', '/posts/abc/comments/edf')
expect(res.length).toBe(1)
expect(res[0][0]).toBe('comment')
expect(res[0][1]).toEqual({ id: 'abc', comment_id: 'edf' })
})
describe('child', () => {

View File

@ -2,7 +2,7 @@
"compilerOptions": {
"target": "ES2020",
"declaration": true,
"moduleResolution": "Node",
"moduleResolution": "Bundler",
"outDir": "./dist",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,

826
yarn.lock

File diff suppressed because it is too large Load Diff