LogoRobo.js
Packages@robojs/server

TestRouteResult

Interface: TestRouteResult

Result type for route testing that includes both Response and convenience methods

Properties

PropertyTypeDescription
okbooleanWhether response status is 2xx
responseResponseThe raw Response object
statusnumberResponse status code

Methods

header(name): string

Get a response header value

Parameters

ParameterType
namestring

Returns

string


json()

json<T>(): Promise<T>

Parse response body as JSON

Type Parameters

Type ParameterDefault type
Tunknown

Returns

Promise<T>


text()

text(): Promise<string>

Get response body as text

Returns

Promise<string>

On this page