Skip to content

ajax

Sends an HTTP request through XMLHttpRequest, reporting the outcome through the success and error callbacks. A no-op in the mock: no request is sent and neither callback is called.

Import:

import 'obsidian-test-mocks/setup';

Signature:

function ajax(_options: AjaxOptions): void

Parameters:

Parameter Type Description
_options AjaxOptions The request’s URL, method, data, headers and callbacks. Ignored by the mock.

Returns: void