Skip to content

Commit

Permalink
fix: test error
Browse files Browse the repository at this point in the history
  • Loading branch information
saseungmin committed Oct 11, 2024
1 parent a6c69c5 commit 6fdaae6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/fetch/src/fetch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ describe('fetchApi', () => {

context('fetch가 성공한 경우', () => {
const defaultUrl = '/test/test';
const defaultHeaders = {
'Content-Type': 'application/json',
};

context('params가 없는 경우', () => {
(window.fetch as jest.Mock) = jest.fn(() => Promise.resolve({
Expand All @@ -60,7 +63,7 @@ describe('fetchApi', () => {
expect(response).toBe(mockResponse);
expect(fetch).toBeCalledWith(defaultUrl, {
body: undefined,
headers: undefined,
headers: defaultHeaders,
method: 'GET',
signal: expect.any(AbortSignal),
});
Expand All @@ -79,7 +82,7 @@ describe('fetchApi', () => {
expect(response).toBe(mockResponse);
expect(fetch).toBeCalledWith(`${defaultUrl}?test=test`, {
body: undefined,
headers: undefined,
headers: defaultHeaders,
method: 'GET',
signal: expect.any(AbortSignal),
});
Expand Down

0 comments on commit 6fdaae6

Please sign in to comment.