Skip to main content
Module

x/superdeno/mod.ts>Test#expect

Super-agent driven library for testing Deno HTTP servers.
Go to Latest
method Test.prototype.expect
import { Test } from "https://deno.land/x/superdeno@4.8.0/mod.ts";

Expectations:

.expect(fn)

Parameters

callback: ExpectChecker

Returns

this

for chaining

Expectations:

.expect(200) .expect(200, fn)

Parameters

status: number
optional
callback: CallbackHandler

Returns

this

for chaining

Expectations:

.expect(200, body) .expect(200, body, fn)

Parameters

status: number
body: any
optional
callback: CallbackHandler

Returns

this

for chaining

Expectations:

.expect('Some body') .expect(/Some body/i) .expect('Some body', fn)

Parameters

body: string | RegExp | Object
optional
callback: CallbackHandler

Returns

this

for chaining

Expectations:

.expect('Content-Type', 'application/json') .expect('Content-Type', /application/g', fn)

Parameters

field: string
value: string | RegExp | number
optional
callback: CallbackHandler

Returns

this

for chaining