8000 test: 올리브영 timeout 검증의 간헐 실패 수정 by hmmhmmhm · Pull Request #289 · hmmhmmhm/daiso-mcp · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/api/oliveyoung-handlers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ describe('handleOliveyoungFindStores', () => {
});

it('timeoutMs 쿼리를 올리브영 매장 검색 요청에 전달한다', async () => {
vi.spyOn(Date, 'now').mockReturnValue(1700000000000);
const timeoutSpy = vi.spyOn(globalThis, 'setTimeout');
mockFetch.mockResolvedValue(
createMockDirectResponse({
Expand All @@ -92,6 +93,7 @@ describe('handleOliveyoungFindStores', () => {
});

it('매장 검색 timeoutMs 쿼리가 유효하지 않으면 기본 제한 시간을 사용한다', async () => {
vi.spyOn(Date, 'now').mockReturnValue(1700000000000);
const timeoutSpy = vi.spyOn(globalThis, 'setTimeout');
mockFetch.mockResolvedValue(
createMockDirectResponse({
Expand Down Expand Up @@ -200,6 +202,7 @@ describe('handleOliveyoungSearchProducts', () => {
});

it('timeoutMs 쿼리를 올리브영 상품 검색 요청에 전달한다', async () => {
vi.spyOn(Date, 'now').mockReturnValue(1700000000000);
const timeoutSpy = vi.spyOn(globalThis, 'setTimeout');
mockFetch.mockResolvedValue(
createMockDirectResponse({
Expand All @@ -215,6 +218,7 @@ describe('handleOliveyoungSearchProducts', () => {
});

it('상품 검색 timeoutMs 쿼리가 0 이하이면 기본 제한 시간을 사용한다', async () => {
vi.spyOn(Date, 'now').mockReturnValue(1700000000000);
const timeoutSpy = vi.spyOn(globalThis, 'setTimeout');
mockFetch.mockResolvedValue(
createMockDirectResponse({
Expand Down Expand Up @@ -364,6 +368,7 @@ describe('handleOliveyoungCheckInventory', () => {
});

it('timeoutMs 쿼리를 올리브영 재고 요청에 전달한다', async () => {
vi.spyOn(Date, 'now').mockReturnValue(1700000000000);
const timeoutSpy = vi.spyOn(globalThis, 'setTimeout');
mockFetch
.mockResolvedValueOnce(
Expand Down Expand Up @@ -402,6 +407,7 @@ describe('handleOliveyoungCheckInventory', () => {
});

it('timeoutMs 쿼리가 0 이하이면 기본 제한 시간을 사용한다', async () => {
vi.spyOn(Date, 'now').mockReturnValue(1700000000000);
const timeoutSpy = vi.spyOn(globalThis, 'setTimeout');
mockFetch.mockRejectedValue(new Error('inventory fail'));

Expand Down
Loading
0