|
|
@@ -174,7 +174,7 @@ describe('用户API集成测试 (使用hono/testing)', () => {
|
|
|
});
|
|
|
|
|
|
const response = await client.users[':id'].$get({
|
|
|
- param: { id: testUser.id.toString() }
|
|
|
+ param: { id: testUser.id }
|
|
|
},
|
|
|
{
|
|
|
headers: {
|
|
|
@@ -193,7 +193,7 @@ describe('用户API集成测试 (使用hono/testing)', () => {
|
|
|
|
|
|
it('应该返回404当用户不存在时', async () => {
|
|
|
const response = await client.users[':id'].$get({
|
|
|
- param: { id: '999999' }
|
|
|
+ param: { id: 999999 }
|
|
|
},
|
|
|
{
|
|
|
headers: {
|
|
|
@@ -224,7 +224,7 @@ describe('用户API集成测试 (使用hono/testing)', () => {
|
|
|
};
|
|
|
|
|
|
const response = await client.users[':id'].$put({
|
|
|
- param: { id: testUser.id.toString() },
|
|
|
+ param: { id: testUser.id },
|
|
|
json: updateData
|
|
|
},
|
|
|
{
|
|
|
@@ -242,7 +242,7 @@ describe('用户API集成测试 (使用hono/testing)', () => {
|
|
|
|
|
|
// 验证数据库中的更新
|
|
|
const getResponse = await client.users[':id'].$get({
|
|
|
- param: { id: testUser.id.toString() }
|
|
|
+ param: { id: testUser.id }
|
|
|
});
|
|
|
expect(getResponse.status).toBe(200);
|
|
|
if (getResponse.status === 200) {
|
|
|
@@ -258,7 +258,7 @@ describe('用户API集成测试 (使用hono/testing)', () => {
|
|
|
};
|
|
|
|
|
|
const response = await client.users[':id'].$put({
|
|
|
- param: { id: '999999' },
|
|
|
+ param: { id: 999999 },
|
|
|
json: updateData
|
|
|
},
|
|
|
{
|
|
|
@@ -285,7 +285,7 @@ describe('用户API集成测试 (使用hono/testing)', () => {
|
|
|
});
|
|
|
|
|
|
const response = await client.users[':id'].$delete({
|
|
|
- param: { id: testUser.id.toString() }
|
|
|
+ param: { id: testUser.id }
|
|
|
},
|
|
|
{
|
|
|
headers: {
|
|
|
@@ -300,14 +300,14 @@ describe('用户API集成测试 (使用hono/testing)', () => {
|
|
|
|
|
|
// 验证再次获取用户返回404
|
|
|
const getResponse = await client.users[':id'].$get({
|
|
|
- param: { id: testUser.id.toString() }
|
|
|
+ param: { id: testUser.id }
|
|
|
});
|
|
|
IntegrationTestAssertions.expectStatus(getResponse, 404);
|
|
|
});
|
|
|
|
|
|
it('应该返回404当删除不存在的用户时', async () => {
|
|
|
const response = await client.users[':id'].$delete({
|
|
|
- param: { id: '999999' }
|
|
|
+ param: { id: 999999 }
|
|
|
},
|
|
|
{
|
|
|
headers: {
|