Skip to content

Commit 1a66c98

Browse files
committed
fix: improve test
1 parent 0e50696 commit 1a66c98

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

test/browser-fetch.test.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,10 @@ describe('mock fetch requests for browser envrioment', () => {
247247
});
248248

249249
it('should support URL objects being passed into fetch', async () => {
250-
mocker.mock({
251-
url: 'http://example.com/some/api',
252-
method: 'post',
253-
body: () => 'some mock response',
254-
});
250+
mocker.get('http://example.com/some/api', 'get content');
255251
const res = await fetch(new URL('http://example.com/some/other/api'), {
256252
method: 'post',
257-
});
258-
expect(res.status).toBe(404);
253+
}).then((res) => res.text());
254+
expect(res).toBe('get content');
259255
});
260256
});

0 commit comments

Comments
 (0)