mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
Configurations: 'specification/networkfunction/resource-manager/Microsoft.NetworkFunction/TrafficCollector/tspconfig.yaml', API Version: 2022-11-01, SDK Release Type: beta, and CommitSHA: '3e0c16b4e69111860b9cb246f0eb64bd67ae6db1' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6485336 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --------- Co-authored-by: Jiao Di (MSFT) <[email protected]>
28 lines
981 B
TypeScript
28 lines
981 B
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
import { AzureTrafficCollectorClient } from "../src/index.js";
|
|
import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity";
|
|
import { setLogLevel } from "@azure/logger";
|
|
import { describe, it } from "vitest";
|
|
|
|
describe("snippets", () => {
|
|
it("ReadmeSampleCreateClient_Node", async () => {
|
|
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
|
const client = new AzureTrafficCollectorClient(new DefaultAzureCredential(), subscriptionId);
|
|
});
|
|
|
|
it("ReadmeSampleCreateClient_Browser", async () => {
|
|
const credential = new InteractiveBrowserCredential({
|
|
tenantId: "<YOUR_TENANT_ID>",
|
|
clientId: "<YOUR_CLIENT_ID>",
|
|
});
|
|
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
|
const client = new AzureTrafficCollectorClient(credential, subscriptionId);
|
|
});
|
|
|
|
it("SetLogLevel", async () => {
|
|
setLogLevel("info");
|
|
});
|
|
});
|