Detect if Meticulous is Running as a Test

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):

Frontend

if (window.Meticulous?.isRunningAsTest) {
  ...
}

Backend and Server Components

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: