chore: add fetch funtcion & add tests to helper module
This commit is contained in:
parent
e289aeea27
commit
7b5e820285
22 changed files with 315 additions and 17 deletions
11
packages/helper/fetch.test.ts
Normal file
11
packages/helper/fetch.test.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { fetch } from "./fetch"
|
||||
|
||||
describe("myFetch()", () => {
|
||||
it("should return data from the server", async () => {
|
||||
const response = await fetch("https://example.com")
|
||||
expect(response.ok).toBe(true)
|
||||
expect(response.status).toBe(200)
|
||||
const data = await response.text()
|
||||
expect(data).toMatch("Example Domain")
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue