Files
Jiao Di (MSFT)andGitHub a4109b7e24 [mgmt] migrate mgmt package to esm 23 (#33053)
https://github.com/Azure/azure-sdk-for-js/issues/32184
@azure/arm-signalr
@azure/arm-servicemap
@azure/arm-servicelinker
@azure/arm-servicefabricmesh
@azure/arm-servicefabricmanagedclusters
@azure/arm-securitydevops
2025-02-17 21:51:10 +08:00

62 lines
2.0 KiB
TypeScript

/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { env, Recorder, RecorderStartOptions, isPlaybackMode } from "@azure-tools/test-recorder";
import { createTestCredential } from "@azure-tools/test-credential";
import { MicrosoftSecurityDevOps } from "../src/microsoftSecurityDevOps.js";
import { describe, it, beforeEach, afterEach } from "vitest";
const replaceableVariables: Record<string, string> = {
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",
};
const recorderOptions: RecorderStartOptions = {
envSetupForPlayback: replaceableVariables,
removeCentralSanitizers: [
"AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section
"AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section
],
};
export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};
describe("securitydevops test", () => {
let recorder: Recorder;
let subscriptionId: string;
let client: MicrosoftSecurityDevOps;
beforeEach(async (ctx) => {
recorder = new Recorder(ctx);
await recorder.start(recorderOptions);
subscriptionId = env.SUBSCRIPTION_ID || "";
// This is an example of how the environment variables are used
const credential = createTestCredential();
client = new MicrosoftSecurityDevOps(
credential,
subscriptionId,
recorder.configureClientOptions({}),
);
});
afterEach(async () => {
await recorder.stop();
});
it("azureDevOps operation list test", async () => {
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
});
});