Skip to content

Mock API

To enable you to develop outside of iDetailAid, but still call the injected API commands, you can use a mock API.

This consists of two files; a mock API, and mock presentation data.

You can edit the presentation manifest data to fit your testing needs.

The mock API can be downloaded here:

Info

The latest mock API and Manifest data can be downloaded directly from any iDetailAid presentation viewer.

Preview a slide, open the console, and run the following command:

Viewer.api.writeMockAPI()

and

Viewer.api.writeMockManifest()

This wills save two files that mocks the API.

Simply include these into your HTML package, ensuring the manifest is included first.

<script src="iDetailAid_mock_viewer_manifest.js"></script>
<script src="iDetailAid_mock_viewer_api.js"></script>

You can then edit the mock manifest to structure the data how you want for testing.

This can be left in when deployed to iDetailAid; the actual API will take precedence over the mock API.