Skip to content

apollo-code


apollo-code / tools/src / MockWebSearchProvider

Class: MockWebSearchProvider

Deterministic offline provider for contract tests; it performs no I/O.

Implements

Constructors

Constructor

new MockWebSearchProvider(id, responses): MockWebSearchProvider

Parameters

id

string

responses

MockWebSearchResponse[]

Returns

MockWebSearchProvider

Properties

calls

readonly calls: object[] = []

limit

limit: number

query

query: string


id

readonly id: string

Implementation of

WebSearchProvider.id

Methods

search(request, context): Promise<readonly WebSearchProviderResult[]>

Parameters

request
limit

number

query

string

context
signal

AbortSignal

Returns

Promise<readonly WebSearchProviderResult[]>

Implementation of

WebSearchProvider.search