Skip to content

Interface: MockExecutionContext

testing.MockExecutionContext

An object passed to the execute function of every formula invocation with information and utilities for handling the invocation. In particular, this contains the Fetcher, which is used for making HTTP requests.

Hierarchy

MockExecutionContext

↳↳ MockSyncExecutionContext

Properties

endpoint

Optional Readonly endpoint: string

The base endpoint URL for the user's account, only if applicable. See requiresEndpointUrl.

If the API URLs are variable based on the user account, you will need this endpoint to construct URLs to use with the fetcher. Alternatively, you can use relative URLs (e.g. "/api/entity") and Coda will include the endpoint for you automatically.

Inherited from

ExecutionContext.endpoint

Defined in

api_types.ts:796


fetcher

fetcher: Object

The Fetcher used for making HTTP requests.

Type declaration

Name Type
fetch SinonStub<any[], any>

Overrides

ExecutionContext.fetcher

Defined in

testing/mocks.ts:8


invocationLocation

Readonly invocationLocation: InvocationLocation

Information about the Coda environment and doc this formula was invoked from. This is mostly for Coda internal use and we do not recommend relying on it.

Inherited from

ExecutionContext.invocationLocation

Defined in

api_types.ts:801


invocationToken

Readonly invocationToken: string

A random token scoped to only this request invocation. This is a unique identifier for the invocation, and in particular used with Custom for naming template parameters that will be replaced by the fetcher in secure way.

Inherited from

ExecutionContext.invocationToken

Defined in

api_types.ts:812


sync

Optional Readonly sync: Sync

Information about state of the current sync. Only populated if this is a sync table formula.

Inherited from

ExecutionContext.sync

Defined in

api_types.ts:816


temporaryBlobStorage

temporaryBlobStorage: Object

A utility to fetch and store files and images that either require the pack user's authentication or are too large to return inline. See TemporaryBlobStorage.

Type declaration

Name Type
storeBlob SinonStub<any[], any>
storeUrl SinonStub<any[], any>

Overrides

ExecutionContext.temporaryBlobStorage

Defined in

testing/mocks.ts:11


timezone

Readonly timezone: string

The timezone of the doc from which this formula was invoked.

Inherited from

ExecutionContext.timezone

Defined in

api_types.ts:805