Testing Fraud Detection
Use thesimulateVpn and simulateImpossibleTravel flags on vouch.fraud.assess() and vouch.escrow.assess() to force specific risk outcomes in your development environment.
AMBER result, use a freshly created test user ID (so the account has no verification history) together with a high transaction amount. This typically triggers identity_not_verified and nudges the score into the 40–69 range.
Testing Identity Verification
In development,vouch.identity.submitVerification() still processes files through the full pipeline — you can pass any image file and observe the response. Use distinct externalUserId values for each test case so the results don’t overwrite one another.
device_mismatch signal handling), set globalThis.MOCK_FINGERPRINT to a fixed string before initialising the SDK. This prevents the fingerprinting library from querying real browser APIs, which are unavailable in Node test environments.
MOCK_FINGERPRINT value in a second test to simulate a device change and verify that your device_mismatch handling code is reached.
Unit Testing Tips
For unit tests where you want zero network calls, mock the entirevouch-sdk module. The mock below stubs every method used across the KYC, fraud, and escrow flows with sensible defaults that you can override per test.
Keep your unit test mocks in sync with the actual SDK response shapes shown in the Fraud Assessment and KYC Flow guides. Stale mock data is one of the most common causes of tests that pass locally but fail against the live API.