import { Context } from "mocha" ; import { env , record , RecorderEnvironmentSetup , Recorder } from "@azure-tools/test-recorder" ; import "./env" ; const recorderEnvSetup = { replaceableVariables : { ENDPOINT : "https://endpoint" , AZURE_CLIENT_ID : "azure_client_id" , AZURE_CLIENT_SECRET : "azure_client_secret" , AZURE_TENANT_ID : "88888888-8888-8888-8888-888888888888" , SUBSCRIPTION_ID : "azure_subscription_id" } , customizationsOnRecordings : [ ( recording ) : any => recording . replace ( /"access_token":"[^"]*"/g , `"access_token":"access_token"` ) , ( recording ) : string => { const replaced = recording . replace ( "endpoint:443" , "endpoint" ) ; return replaced ; } ] , queryParametersToSkip : [ ] } ; /**
 * creates the recorder and reads the environment variables from the `.env` file.
 * Should be called first in the test suite to make sure environment variables are
 * read before they are being used.
 */ export function createRecorder ( context ) { return record ( context , recorderEnvSetup ) ; }