startMockingTool
startMockingTool(): voidSource: main.ts:97
Manually triggers the mocking tool to inject a mock container. Useful for testing orientation logic in environments where device sensors are unavailable.
Note: The mocking tool is automatically enabled in development environments by default. You can disable this behavior using setConfig with { autoStartMockingTool: false }.
Returns
void
Example
CODE
import { deviceRotation } from "simple-web-orientation";
// 1. Disable automatic mocking tool injection
deviceRotation.setConfig({
autoStartMockingTool: false
});
// 2. Manually activate the mocking tool:
deviceRotation.startMockingTool();