mirror of
https://github.com/honojs/hono.git
synced 2024-11-24 11:07:29 +01:00
parent
76dbc74407
commit
8addfd442a
@ -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"
|
||||
},
|
||||
|
@ -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', () => {
|
||||
|
@ -2,7 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"declaration": true,
|
||||
"moduleResolution": "Node",
|
||||
"moduleResolution": "Bundler",
|
||||
"outDir": "./dist",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
|
Loading…
Reference in New Issue
Block a user