import { Test } from "https://deno.land/x/superdeno@4.9.0/mod.ts";
The SuperDeno Test object extends the methods provided by superagent to provide a high-level abstraction for testing HTTP, while still allowing you to drop down to the lower-level API provided by superagent.
Methods
end(callback?: CallbackHandler): this
Defer invoking superagent's .end()
until
the server is listening.
expect(callback: ExpectChecker): this
Expectations:
.expect(fn)
expect(status: number, callback?: CallbackHandler): this
Expectations:
.expect(200) .expect(200, fn)
expect(): this
status: number,
body: any,
callback?: CallbackHandler,
Expectations:
.expect(200, body) .expect(200, body, fn)
expect(body: string | RegExp | Object, callback?: CallbackHandler): this
Expectations:
.expect('Some body') .expect(/Some body/i) .expect('Some body', fn)
expect(): this
field: string,
value: string | RegExp | number,
callback?: CallbackHandler,
Expectations:
.expect('Content-Type', 'application/json') .expect('Content-Type', /application/g', fn)