Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/superoak/deps.ts>Test#expect

HTTP assertions for Oak made easy via SuperDeno. 🐿 🦕
Latest
method Test.prototype.expect
import { Test } from "https://deno.land/x/superoak@4.8.1/deps.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