Skip to content

Commit

Permalink
[EngSys] Update name of @azure-tools/test-utils ***NO_CI***
Browse files Browse the repository at this point in the history
  • Loading branch information
mpodwysocki authored and scbedd committed Apr 25, 2024
1 parent 8cd5bc2 commit 769c1b1
Show file tree
Hide file tree
Showing 286 changed files with 398 additions and 401 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const examplePackageGood = `{
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^2.0.1",
"@azure/mock-hub": "^1.0.0",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-utils": "^1.0.0",
"@azure-tools/test-perf": "^1.0.0",
"@microsoft/api-extractor": "^7.31.1",
"@rollup/plugin-commonjs": "11.0.2",
Expand Down Expand Up @@ -263,7 +263,7 @@ const examplePackageBad = `{
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^2.0.1",
"@azure/mock-hub": "^1.0.0",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-utils": "^1.0.0",
"@azure-tools/test-perf": "^1.0.0",
"@microsoft/api-extractor": "^7.31.1",
"@rollup/plugin-commonjs": "11.0.2",
Expand Down
4 changes: 2 additions & 2 deletions rush.json
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@
"versionPolicyName": "utility"
},
{
"packageName": "@azure/test-utils",
"packageName": "@azure-tools/test-utils",
"projectFolder": "sdk/test-utils/test-utils",
"versionPolicyName": "utility"
},
Expand Down Expand Up @@ -2219,4 +2219,4 @@
"versionPolicyName": "management"
}
]
}
}
2 changes: 1 addition & 1 deletion sdk/agrifood/agrifood-farming-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^4.0.1",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-utils": "^1.0.0",
"@azure-tools/test-credential": "^1.0.0",
"@azure-tools/test-recorder": "^3.0.0",
"@microsoft/api-extractor": "^7.31.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"typescript": "~5.4.5",
"util": "^0.12.1",
"dotenv": "^16.0.0",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-utils": "^1.0.0",
"@types/mustache": "^4.2.1",
"sinon": "^17.0.0",
"@types/sinon": "^17.0.0"
Expand Down
2 changes: 1 addition & 1 deletion sdk/appconfiguration/app-configuration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"@azure/keyvault-secrets": "^4.2.0",
"@azure-tools/test-credential": "^1.0.0",
"@azure-tools/test-recorder": "^3.1.0",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-utils": "^1.0.0",
"@microsoft/api-extractor": "^7.31.1",
"@types/chai": "^4.1.6",
"@types/mocha": "^10.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Recorder } from "@azure-tools/test-recorder";
import { createAppConfigurationClientForTests, startRecorder } from "./utils/testHelpers";
import { AppConfigurationClient } from "../../src/appConfigurationClient";
import { Context } from "mocha";
import { assert } from "@azure/test-utils";
import { assert } from "@azure-tools/test-utils";

describe("supports tracing", () => {
let client: AppConfigurationClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^4.0.1",
"@azure/logger": "^1.0.3",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-utils": "^1.0.0",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^1.0.0",
"@microsoft/api-extractor": "^7.31.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { AuthMethod, createClient, startRecorder } from "./utils/recordedClient";
import { Context, Suite } from "mocha";
import { assert, matrix } from "@azure/test-utils";
import { assert, matrix } from "@azure-tools/test-utils";
import { ConversationAnalysisClient } from "../../src";
import { Recorder, assertEnvironmentVariable } from "@azure-tools/test-recorder";

Expand Down
3 changes: 2 additions & 1 deletion sdk/cognitivelanguage/ai-language-text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^4.0.1",
"@azure/test-utils": "^1.0.0",
"@azure/core-util": "^1.9.0",
"@azure-tools/test-utils": "^1.0.0",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^1.0.0",
"@microsoft/api-extractor": "^7.31.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT license.

import { createHttpHeaders, PipelineRequest } from "@azure/core-rest-pipeline";
import { assert } from "@azure/test-utils";
import { assert } from "@azure-tools/test-utils";
import { KnownErrorCode } from "../../src/generated";
import { AnalyzeBatchActionNames } from "../../src/models";
import { TextAnalysisClient } from "../../src/textAnalysisClient";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { AnalyzeAction, KnownAnalyzeTextLROTaskKind } from "../../src/generated/models";
import { AnalyzeActionName, AnalyzeBatchActionName } from "../../src";
import { AssertEqual } from "./utils";
import { assert } from "@azure/test-utils";
import { assert } from "@azure-tools/test-utils";

describe("Models", function () {
it("AnalyzeActionName", function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AzureKeyCredential, TextAnalysisClient } from "../../src";
import { createHttpHeaders } from "@azure/core-rest-pipeline";
import sinon from "sinon";
import { setLogLevel } from "@azure/logger";
import { isNode } from "@azure/test-utils";
import { isNodeLike } from "@azure/core-util";

function makeClientWithWarnText(content: string): TextAnalysisClient {
return new TextAnalysisClient("https://endpoint", new AzureKeyCredential("test"), {
Expand All @@ -24,7 +24,7 @@ describe("Logging", function () {
const content = "The API version 1 is going to be deprecated by some time in the future";
const client = makeClientWithWarnText(content);
let spy;
if (isNode) {
if (isNodeLike) {
spy = sinon.spy(process.stderr, "write");
} else {
spy = sinon.spy(console, "warn");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { assertEnvironmentVariable, isPlaybackMode, Recorder } from "@azure-tools/test-recorder";
import { AnalyzeBatchActionNames, AzureKeyCredential, TextAnalysisClient } from "../../src";
import { matrix } from "@azure/test-utils";
import { matrix } from "@azure-tools/test-utils";
import { Context, Suite } from "mocha";
import { AuthMethod, createClient, startRecorder } from "../public/utils/recordedClient";
import createAuthoringClient, { TextAuthoringClient } from "@azure/ai-language-textauthoring";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from "../../src";
import { AuthMethod, createClient, startRecorder } from "./utils/recordedClient";
import { Context, Suite } from "mocha";
import { assert, matrix } from "@azure/test-utils";
import { assert, matrix } from "@azure-tools/test-utils";
import { assertActionResults, assertRestError } from "./utils/resultHelper";
import { checkEntityTextOffset, checkOffsetAndLength } from "./utils/stringIndexTypeHelpers";
import { Recorder } from "@azure-tools/test-recorder";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { AuthMethod, createClient, startRecorder } from "./utils/recordedClient";
import { Context, Suite } from "mocha";
import { Recorder, isPlaybackMode } from "@azure-tools/test-recorder";
import { assert, matrix } from "@azure/test-utils";
import { assert, matrix } from "@azure-tools/test-utils";
import { assertActionsResults, assertRestError } from "./utils/resultHelper";
import {
expectation10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Context, Suite } from "mocha";
import { createClient, startRecorder } from "./utils/recordedClient";
import { FullOperationResponse } from "@azure/core-client";
import { Recorder } from "@azure-tools/test-recorder";
import { assert } from "@azure/test-utils";
import { assert } from "@azure-tools/test-utils";

describe(`[API Key] TextAnalysisClient`, function (this: Suite) {
let recorder: Recorder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
KnownTextAnalysisErrorCode,
PagedAnalyzeBatchResult,
} from "../../../src/";
import { assert } from "@azure/test-utils";
import { assert } from "@azure-tools/test-utils";
import { isRestError } from "@azure/core-rest-pipeline";

export async function assertActionsResults(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"typescript": "~5.4.5",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-utils": "^1.0.0",
"mocha": "^10.0.0",
"nyc": "^15.1.0",
"ts-node": "^10.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT license.

import { Suite } from "mocha";
import { assert } from "@azure/test-utils";
import { assert } from "@azure-tools/test-utils";
import createAuthoringClient from "../../src";
import { AzureKeyCredential } from "@azure/core-auth";
describe(`Authoring Test`, function (this: Suite) {
Expand Down
3 changes: 2 additions & 1 deletion sdk/communication/communication-alpha-ids/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^4.0.1",
"@azure/test-utils": "^1.0.0",
"@azure/core-util": "^1.9.0",
"@azure-tools/test-utils": "^1.0.0",
"@microsoft/api-extractor": "^7.31.1",
"@types/chai": "^4.1.6",
"@types/mocha": "^10.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { AlphaIDsClient as AlphaIDsGeneratedClient } from "../../src/generated/s
import { TokenCredential } from "@azure/identity";
import { assert } from "chai";
import { createMockToken } from "../public/utils/recordedClient";
import { isNode } from "@azure/test-utils";
import { isNodeLike } from "@azure/core-util";
import { parseClientArguments } from "@azure/communication-common";
import sinon from "sinon";
import { HttpClient, PipelineRequest, PipelineResponse } from "@azure/core-rest-pipeline";
Expand Down Expand Up @@ -39,7 +39,7 @@ export const userAgentPolicy: (policyName: string, customHeader: string) => Pipe
return {
name: policyName,
sendRequest: async (req, next) => {
const userAgentHeader = isNode ? "user-agent" : "x-ms-useragent";
const userAgentHeader = isNodeLike ? "user-agent" : "x-ms-useragent";
req.headers.set(userAgentHeader, customHeader);
return next(req);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { TokenCredential } from "@azure/identity";
import { assert } from "chai";
import { createMockToken } from "../public/utils/recordedClient";
import { configurationHttpClient } from "../public/utils/mockHttpClients";
import { isNode } from "@azure/test-utils";
import { isNodeLike } from "@azure/core-util";
import sinon from "sinon";

describe("AlphaIdsClient - headers", function () {
Expand All @@ -34,14 +34,14 @@ describe("AlphaIdsClient - headers", function () {
});

it("[node] sets correct host", function (this: Context) {
if (!isNode) {
if (!isNodeLike) {
this.skip();
}
assert.equal(request.headers.get("host"), "contoso.spool.azure.local");
});

it("sets correct default user-agent", function () {
const userAgentHeader = isNode ? "user-agent" : "x-ms-useragent";
const userAgentHeader = isNodeLike ? "user-agent" : "x-ms-useragent";
assert.match(
request.headers.get(userAgentHeader) as string,
new RegExp(`azsdk-js-communication-alpha-ids/${SDK_VERSION}`, "g"),
Expand Down Expand Up @@ -108,7 +108,7 @@ describe("AlphaIdsClient - headers", function () {

request = spy.getCall(0).args[0];

const userAgentHeader = isNode ? "user-agent" : "x-ms-useragent";
const userAgentHeader = isNodeLike ? "user-agent" : "x-ms-useragent";
assert.match(
request.headers.get(userAgentHeader) as string,
new RegExp(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import * as dotenv from "dotenv";

import * as dotenv from "dotenv";
import { ClientSecretCredential, DefaultAzureCredential, TokenCredential } from "@azure/identity";
import {
Recorder,
Expand All @@ -12,11 +12,11 @@ import {
} from "@azure-tools/test-recorder";
import { AlphaIdsClient } from "../../../src";
import { Context } from "mocha";
import { isNode } from "@azure/test-utils";
import { isNodeLike } from "@azure/core-util";
import { parseConnectionString } from "@azure/communication-common";
import { createMSUserAgentPolicy } from "./msUserAgentPolicy";

if (isNode) {
if (isNodeLike) {
dotenv.config();
}

Expand Down Expand Up @@ -117,7 +117,7 @@ export async function createRecordedClientWithToken(
};
}

if (isNode) {
if (isNodeLike) {
credential = new DefaultAzureCredential();
} else {
credential = new ClientSecretCredential(
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-email/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"devDependencies": {
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-utils": "^1.0.0",
"@azure-tools/test-recorder": "^3.0.0",
"@microsoft/api-extractor": "^7.31.1",
"@types/node": "^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-identity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^4.0.1",
"@azure/msal-node": "^2.7.0",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-utils": "^1.0.0",
"@microsoft/api-extractor": "^7.31.1",
"@types/chai": "^4.1.6",
"@types/mocha": "^10.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { CommunicationIdentityClient, TokenScope } from "../../src";
import { Context } from "mocha";
import { assert } from "chai";
import { matrix } from "@azure/test-utils";
import { matrix } from "@azure-tools/test-utils";

matrix([[true, false]], async function (useAad: boolean) {
describe(`CommunicationIdentityClient [Playback/Live]${useAad ? " [AAD]" : ""}`, function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
createRecordedCommunicationIdentityClientWithToken,
} from "../utils/recordedClient";
import { PublicClientApplication } from "@azure/msal-node";
import { matrix } from "@azure/test-utils";
import { matrix } from "@azure-tools/test-utils";
import { Context } from "mocha";
import { assert } from "chai";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CommunicationUserIdentifier } from "@azure/communication-common";
import { Recorder, isLiveMode } from "@azure-tools/test-recorder";
import { Context } from "mocha";
import { assert } from "chai";
import { matrix } from "@azure/test-utils";
import { matrix } from "@azure-tools/test-utils";
import { CommunicationIdentityClient } from "../../../src/communicationIdentityClient";
import {
createRecordedCommunicationIdentityClient,
Expand Down
4 changes: 2 additions & 2 deletions sdk/communication/communication-phone-numbers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@
"@azure/core-lro": "^2.2.4",
"@azure/core-paging": "^1.1.1",
"@azure/core-tracing": "^1.0.0",
"@azure/core-util": "^1.6.1",
"@azure/core-util": "^1.9.0",
"@azure/logger": "^1.0.0",
"events": "^3.0.0",
"tslib": "^2.2.0"
},
"devDependencies": {
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-utils": "^1.0.0",
"@azure-tools/test-credential": "^1.0.0",
"@azure-tools/test-recorder": "^3.0.0",
"@azure/identity": "^4.0.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { matrix } from "@azure/test-utils";
import { matrix } from "@azure-tools/test-utils";
import { Recorder } from "@azure-tools/test-recorder";
import { assert } from "chai";
import { Context } from "mocha";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT license.

import { setLogLevel } from "@azure/logger";
import { matrix } from "@azure/test-utils";
import { matrix } from "@azure-tools/test-utils";
import { Recorder } from "@azure-tools/test-recorder";
import { assert } from "chai";
import { Context } from "mocha";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { matrix } from "@azure/test-utils";
import { matrix } from "@azure-tools/test-utils";
import { Recorder } from "@azure-tools/test-recorder";
import { assert } from "chai";
import { Context } from "mocha";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { matrix } from "@azure/test-utils";
import { matrix } from "@azure-tools/test-utils";
import { Recorder } from "@azure-tools/test-recorder";
import { assert } from "chai";
import { Context } from "mocha";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { matrix } from "@azure/test-utils";
import { matrix } from "@azure-tools/test-utils";
import { Recorder } from "@azure-tools/test-recorder";
import { assert } from "chai";
import { Context } from "mocha";
Expand Down
Loading

0 comments on commit 769c1b1

Please sign in to comment.