diff --git a/sdk/storage/storage-queue/test/utils/testutils.common.ts b/sdk/storage/storage-queue/test/utils/testutils.common.ts index e2a7ac04d40f..1fbf4f8b8d47 100644 --- a/sdk/storage/storage-queue/test/utils/testutils.common.ts +++ b/sdk/storage/storage-queue/test/utils/testutils.common.ts @@ -5,25 +5,30 @@ export function isBrowser(): boolean { return typeof window !== "undefined"; } +const mockAccountName = "fakestorageaccount"; +const mockAccountKey = "aaaaa"; export const recorderEnvSetup: RecorderEnvironmentSetup = { replaceableVariables: { // Used in record and playback modes // 1. The key-value pairs will be used as the environment variables in playback mode // 2. If the env variales are present in the recordings as plain strings, they will be replaced with the provided values in record mode - ACCOUNT_NAME: "fakestorageaccount", - ACCOUNT_KEY: "aaaaa", - ACCOUNT_SAS: "aaaaa", - STORAGE_CONNECTION_STRING: `DefaultEndpointsProtocol=https;AccountName=${env.ACCOUNT_NAME};AccountKey=${env.ACCOUNT_KEY};EndpointSuffix=core.windows.net`, + ACCOUNT_NAME: `${mockAccountName}`, + ACCOUNT_KEY: `${mockAccountKey}`, + ACCOUNT_SAS: `${mockAccountKey}`, + STORAGE_CONNECTION_STRING: `DefaultEndpointsProtocol=https;AccountName=${mockAccountName};AccountKey=${mockAccountKey};EndpointSuffix=core.windows.net`, // Comment following line to skip user delegation key/SAS related cases in record and play // which depends on this environment variable - ACCOUNT_TOKEN: "aaaaa" + ACCOUNT_TOKEN: `${mockAccountKey}` }, replaceInRecordings: [ // Used in record mode // Array of callback functions can be provided to customize the generated recordings in record mode // `sig` param of SAS Token is being filtered here (recording: string): string => - recording.replace(new RegExp(env.ACCOUNT_SAS.match("(.*)&sig=(.*)")[2], "g"), "aaaaa") + recording.replace( + new RegExp(env.ACCOUNT_SAS.match("(.*)&sig=(.*)")[2], "g"), + `${mockAccountKey}` + ) ], // SAS token may contain sensitive information queryParametersToSkip: [