[go: up one dir, main page]

Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more

superfetch

GitHub Workflow Status Codecov

Superdeno-like superagent testing library based on Fetch API. Ported from node-supertest-fetch.

Example

import { describe, it, run } from 'https://deno.land/x/tincan@1.0.0/mod.ts'
import { http } from 'https://deno.land/std@0.106.0/node/http.ts'
import { makeFetch } from '../mod.ts'

describe('makeFetch', () => {
  it('should work with std/http', async () => {
    const s = http.createServer((req, res) => res.end('Hello World'))

    const fetch = makeFetch(s)

    await fetch('/').expect('Hello World')
  })

run()