If you want to detect if your app is being rendered as part of a Meticulous test, then you can use the window.Meticulous
object on the frontend and the meticulous-is-test
header on the backend (or in server components):
if (window.Meticulous?.isRunningAsTest) {
...
}
Check for the existance of a meticulous-is-test
header: if it's present, then the app is being rendered as part of a Meticulous test.
Alternatively, to securely check if Meticulous is running as a test set a secret in the 'Custom Request Headers' tab of your project's settings screen.
Click below to see instructions for specific frameworks:
For TypeScript type definitions for the window.Meticulous
object, see TypeScript Types for window.Meticulous.