@azure/arm-loadtesting 1.0.0-alpha.20221214.1 → 1.0.0-alpha.20221220.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Azure LoadTest client library for JavaScript
1
+ # Azure Load Testing client library for JavaScript
2
2
 
3
3
  This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure LoadTest client.
4
4
 
@@ -64,6 +64,109 @@ const client = new LoadTestClient(new DefaultAzureCredential(), subscriptionId);
64
64
  // const client = new LoadTestClient(credential, subscriptionId);
65
65
  ```
66
66
 
67
+ ### Create an Azure Load Testing resource
68
+
69
+ Create a new Azure Load Testing resource.
70
+ ```javascript
71
+ loadTestResourceCreatePayload = {
72
+ location: "westus2"
73
+ };
74
+
75
+ const resource = await client.loadTests.beginCreateOrUpdateAndWait(
76
+ "sample-rg",
77
+ "sample-loadtesting-resource",
78
+ loadTestResourceCreatePayload
79
+ );
80
+
81
+ console.log(resource);
82
+ ```
83
+
84
+ Create a new Azure Load Testing resource with managed identity and customer managed key encryption.
85
+ ```javascript
86
+ loadTestResourceCreatePayload = {
87
+ location: "westus2",
88
+ tags: { team: "testing" },
89
+ identity: {
90
+ type: 'SystemAssigned, UserAssigned',
91
+ userAssignedIdentities: {
92
+ '/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1': {}
93
+ }
94
+ },
95
+ encryption: {
96
+ identity: {
97
+ type: 'UserAssigned',
98
+ resourceId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1'
99
+ },
100
+ keyUrl: 'https://sample-kv.vault.azure.net/keys/cmkkey/2d1ccd5c50234ea2a0858fe148b69cde'
101
+ }
102
+ };
103
+
104
+ const resource = await client.loadTests.beginCreateOrUpdateAndWait(
105
+ "sample-rg",
106
+ "sample-loadtesting-resource",
107
+ loadTestResourceCreatePayload
108
+ );
109
+
110
+ console.log(resource);
111
+ ```
112
+
113
+ ### Get an Azure Load Testing resource
114
+
115
+ ```javascript
116
+ let resourceName = 'sample-loadtesting-resource';
117
+ let resourceGroupName = 'sample-rg';
118
+
119
+ const resource = await client.loadTests.get(
120
+ resourceGroupName,
121
+ resourceName
122
+ );
123
+
124
+ console.log(resource);
125
+ ```
126
+
127
+ ### Update an Azure Load Testing resource
128
+
129
+ ```javascript
130
+ loadTestResourcePatchPayload = {
131
+ tags: { team: "testing-dev" },
132
+ identity: {
133
+ type: 'SystemAssigned, UserAssigned',
134
+ userAssignedIdentities: {
135
+ // removing a user-assigned managed identity by assigning the value in the payload as null
136
+ '/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1': null,
137
+ '/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity2': {}
138
+ }
139
+ },
140
+ encryption: {
141
+ // use system-assigned managed identity for CMK encryption
142
+ identity: {
143
+ type: 'SystemAssigned',
144
+ resourceId: null
145
+ },
146
+ keyUrl: 'https://sample-kv.vault.azure.net/keys/cmkkey/2d1ccd5c50234ea2a0858fe148b69cde'
147
+ }
148
+ };
149
+
150
+ const resource = await client.loadTests.beginUpdateAndWait(
151
+ "sample-rg",
152
+ "sample-loadtesting-resource",
153
+ loadTestResourcePatchPayload
154
+ );
155
+
156
+ console.log(resource);
157
+ ```
158
+
159
+ ### Delete an Azure Load Testing resource
160
+
161
+ ```javascript
162
+ let resourceName = 'sample-loadtesting-resource';
163
+ let resourceGroupName = 'sample-rg';
164
+
165
+ const result = await client.loadTests.beginDeleteAndWait(
166
+ resourceGroupName,
167
+ resourceName
168
+ );
169
+ ```
67
170
 
68
171
  ### JavaScript Bundle
69
172
  To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=loadtesting_quota_operations.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadtesting_quota_operations.spec.d.ts","sourceRoot":"","sources":["../../test/loadtesting_quota_operations.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,118 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+ import { __asyncValues, __awaiter } from "tslib";
9
+ import { env, Recorder } from "@azure-tools/test-recorder";
10
+ import { assert } from "chai";
11
+ import { LoadTestClient } from "../src/loadTestClient";
12
+ import { createTestCredential } from "@azure-tools/test-credential";
13
+ const replaceableVariables = {
14
+ AZURE_CLIENT_ID: "azure_client_id",
15
+ AZURE_CLIENT_SECRET: "azure_client_secret",
16
+ AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
17
+ SUBSCRIPTION_ID: "00000000-0000-0000-0000-000000000000"
18
+ };
19
+ const recorderOptions = {
20
+ envSetupForPlayback: replaceableVariables
21
+ };
22
+ describe("Load Testing Quota Operations", () => {
23
+ let recorder;
24
+ let subscriptionId;
25
+ let client;
26
+ let location;
27
+ let quotaBucketRequestPayload;
28
+ let quotaBucketRequestDimensions;
29
+ let quotaBucketName;
30
+ before(function () {
31
+ // Quota bucket request payload
32
+ quotaBucketRequestDimensions = {
33
+ location: location,
34
+ subscriptionId: subscriptionId
35
+ };
36
+ // Set the global variables to be used in the tests
37
+ subscriptionId = env.SUBSCRIPTION_ID || '00000000-0000-0000-0000-000000000000';
38
+ location = env.LOCATION || "westus2";
39
+ quotaBucketName = "maxEngineInstancesPerTestRun";
40
+ });
41
+ beforeEach(function () {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ recorder = new Recorder(this.currentTest);
44
+ yield recorder.start(recorderOptions);
45
+ const credential = createTestCredential();
46
+ client = new LoadTestClient(credential, subscriptionId, recorder.configureClientOptions({}));
47
+ });
48
+ });
49
+ afterEach(function () {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ yield recorder.stop();
52
+ });
53
+ });
54
+ it("list quota buckets", function () {
55
+ var e_1, _a;
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ // Get the quota bucket
58
+ const result = client.quotas.list(location);
59
+ try {
60
+ // Verify the response
61
+ for (var result_1 = __asyncValues(result), result_1_1; result_1_1 = yield result_1.next(), !result_1_1.done;) {
62
+ const quotaBucket = result_1_1.value;
63
+ assert.isNotNull(quotaBucket.name);
64
+ assert.isNotNull(quotaBucket.id);
65
+ assert.isNotNull(quotaBucket.type);
66
+ assert.isNotNull(quotaBucket.limit);
67
+ assert.isNotNull(quotaBucket.usage);
68
+ }
69
+ }
70
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
71
+ finally {
72
+ try {
73
+ if (result_1_1 && !result_1_1.done && (_a = result_1.return)) yield _a.call(result_1);
74
+ }
75
+ finally { if (e_1) throw e_1.error; }
76
+ }
77
+ });
78
+ });
79
+ it("get quota bucket", function () {
80
+ return __awaiter(this, void 0, void 0, function* () {
81
+ // Get the quota bucket
82
+ const result = yield client.quotas.get(location, quotaBucketName);
83
+ // Verify the response
84
+ assert.equal(result.name, quotaBucketName);
85
+ assert.isNotNull(result.id);
86
+ assert.isNotNull(result.type);
87
+ assert.isNotNull(result.limit);
88
+ assert.isNotNull(result.usage);
89
+ });
90
+ });
91
+ it("check quota bucket availability", function () {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ // Get the quota bucket
94
+ const result = yield client.quotas.get(location, quotaBucketName);
95
+ // Verify the response
96
+ assert.equal(result.name, quotaBucketName);
97
+ assert.isNotNull(result.id);
98
+ assert.isNotNull(result.type);
99
+ assert.isNotNull(result.limit);
100
+ assert.isNotNull(result.usage);
101
+ // Quota bucket check availability request payload
102
+ quotaBucketRequestPayload = {
103
+ currentQuota: result.limit,
104
+ currentUsage: result.usage,
105
+ newQuota: result.limit,
106
+ dimensions: quotaBucketRequestDimensions
107
+ };
108
+ // Check the quota bucket availability
109
+ const availability = yield client.quotas.checkAvailability(location, quotaBucketName, quotaBucketRequestPayload);
110
+ // Verify the response
111
+ assert.equal(availability.name, quotaBucketName);
112
+ assert.isNotNull(availability.id);
113
+ assert.isNotNull(availability.type);
114
+ assert.isBoolean(availability.isAvailable);
115
+ });
116
+ });
117
+ });
118
+ //# sourceMappingURL=loadtesting_quota_operations.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadtesting_quota_operations.spec.js","sourceRoot":"","sources":["../../test/loadtesting_quota_operations.spec.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,OAAO,EACL,GAAG,EAEH,QAAQ,EACT,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAMpE,MAAM,oBAAoB,GAA2B;IACnD,eAAe,EAAE,iBAAiB;IAClC,mBAAmB,EAAE,qBAAqB;IAC1C,eAAe,EAAE,sCAAsC;IACvD,eAAe,EAAE,sCAAsC;CACxD,CAAC;AAEF,MAAM,eAAe,GAAyB;IAC5C,mBAAmB,EAAE,oBAAoB;CAC1C,CAAC;AAEF,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,IAAI,QAAkB,CAAC;IACvB,IAAI,cAAsB,CAAC;IAC3B,IAAI,MAAsB,CAAC;IAC3B,IAAI,QAAgB,CAAC;IACrB,IAAI,yBAA6C,CAAC;IAClD,IAAI,4BAAoE,CAAC;IACzE,IAAI,eAAuB,CAAC;IAE5B,MAAM,CAAC;QACL,+BAA+B;QAC/B,4BAA4B,GAAG;YAC7B,QAAQ,EAAE,QAAQ;YAClB,cAAc,EAAE,cAAc;SAC/B,CAAC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EAAE,yBAAyB,CAAC,CAAC;YAEjH,sBAAsB;YACtB,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;YACjD,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YAClC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACpC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAC7C,CAAC;KAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=loadtesting_resource_operations.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadtesting_resource_operations.spec.d.ts","sourceRoot":"","sources":["../../test/loadtesting_resource_operations.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,114 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+ import { __awaiter } from "tslib";
9
+ import { env, Recorder, } from "@azure-tools/test-recorder";
10
+ import { assert } from "chai";
11
+ import { LoadTestClient } from "../src/loadTestClient";
12
+ import { createTestCredential } from "@azure-tools/test-credential";
13
+ const replaceableVariables = {
14
+ AZURE_CLIENT_ID: "azure_client_id",
15
+ AZURE_CLIENT_SECRET: "azure_client_secret",
16
+ AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
17
+ SUBSCRIPTION_ID: "00000000-0000-0000-0000-000000000000"
18
+ };
19
+ const recorderOptions = {
20
+ envSetupForPlayback: replaceableVariables
21
+ };
22
+ describe("Load Testing Resource Operations", () => {
23
+ let recorder;
24
+ let subscriptionId;
25
+ let client;
26
+ let location;
27
+ let resourceGroupName;
28
+ let loadTestResourceName;
29
+ let loadTestResourceCreatePayload;
30
+ let loadTestResourcePatchPayload;
31
+ before(function () {
32
+ // Load test resource create payload
33
+ loadTestResourceCreatePayload = {
34
+ description: "New Load test resource from SDK.",
35
+ location: "westus2",
36
+ tags: { team: "Azure Load Testing SDK" },
37
+ };
38
+ // Load test resource patch payload
39
+ loadTestResourcePatchPayload = {
40
+ identity: {
41
+ type: 'SystemAssigned'
42
+ }
43
+ };
44
+ // Set the global variables to be used in the tests
45
+ subscriptionId = env.SUBSCRIPTION_ID || '00000000-0000-0000-0000-000000000000';
46
+ location = env.LOCATION || "westus2";
47
+ resourceGroupName = env.RESOURCE_GROUP || "js-sdk-test-rg";
48
+ loadTestResourceName = "loadtestsResource";
49
+ });
50
+ beforeEach(function () {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ recorder = new Recorder(this.currentTest);
53
+ yield recorder.start(recorderOptions);
54
+ const credential = createTestCredential();
55
+ client = new LoadTestClient(credential, subscriptionId, recorder.configureClientOptions({}));
56
+ });
57
+ });
58
+ afterEach(function () {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ yield recorder.stop();
61
+ });
62
+ });
63
+ it("create resource", function () {
64
+ var _a, _b, _c;
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ // Create a load test resource
67
+ const resource = yield client.loadTests.beginCreateOrUpdateAndWait(resourceGroupName, loadTestResourceName, loadTestResourceCreatePayload);
68
+ // Verify the response
69
+ assert.equal(resource.provisioningState, "Succeeded");
70
+ assert.equal(resource.name, loadTestResourceName);
71
+ assert.equal(resource.location, location);
72
+ assert.equal((_a = resource.tags) === null || _a === void 0 ? void 0 : _a.team, (_b = loadTestResourceCreatePayload.tags) === null || _b === void 0 ? void 0 : _b.team);
73
+ assert.equal(resource.description, loadTestResourceCreatePayload.description);
74
+ assert.equal((_c = resource.identity) === null || _c === void 0 ? void 0 : _c.type, "None");
75
+ });
76
+ });
77
+ it("get resource", function () {
78
+ var _a, _b, _c;
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ // Get the load test resource
81
+ const resource = yield client.loadTests.get(resourceGroupName, loadTestResourceName);
82
+ // Verify the response
83
+ assert.equal(resource.provisioningState, "Succeeded");
84
+ assert.equal(resource.name, loadTestResourceName);
85
+ assert.equal(resource.location, location);
86
+ assert.equal((_a = resource.tags) === null || _a === void 0 ? void 0 : _a.team, (_b = loadTestResourceCreatePayload.tags) === null || _b === void 0 ? void 0 : _b.team);
87
+ assert.equal(resource.description, loadTestResourceCreatePayload.description);
88
+ assert.equal((_c = resource.identity) === null || _c === void 0 ? void 0 : _c.type, "None");
89
+ });
90
+ });
91
+ it("patch resource", function () {
92
+ var _a, _b, _c, _d;
93
+ return __awaiter(this, void 0, void 0, function* () {
94
+ // Patch the load test resource
95
+ const result = yield client.loadTests.beginUpdateAndWait(resourceGroupName, loadTestResourceName, loadTestResourcePatchPayload);
96
+ // Get the load test resource
97
+ const patchedResource = yield client.loadTests.get(resourceGroupName, loadTestResourceName);
98
+ // Verify the response
99
+ assert.equal(patchedResource.provisioningState, "Succeeded");
100
+ assert.equal(patchedResource.name, loadTestResourceName);
101
+ assert.equal(patchedResource.location, location);
102
+ assert.equal((_a = patchedResource.tags) === null || _a === void 0 ? void 0 : _a.team, (_b = loadTestResourceCreatePayload.tags) === null || _b === void 0 ? void 0 : _b.team);
103
+ assert.equal(patchedResource.description, loadTestResourceCreatePayload.description);
104
+ assert.equal((_c = patchedResource.identity) === null || _c === void 0 ? void 0 : _c.type, (_d = loadTestResourcePatchPayload.identity) === null || _d === void 0 ? void 0 : _d.type);
105
+ });
106
+ });
107
+ it("delete resource", function () {
108
+ return __awaiter(this, void 0, void 0, function* () {
109
+ // Delete the load test resource
110
+ const result = yield client.loadTests.beginDelete(resourceGroupName, loadTestResourceName);
111
+ });
112
+ });
113
+ });
114
+ //# sourceMappingURL=loadtesting_resource_operations.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadtesting_resource_operations.spec.js","sourceRoot":"","sources":["../../test/loadtesting_resource_operations.spec.ts"],"names":[],"mappings":"AAAA;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AE,IAAI,EAAE,MAAA,6BAA6B,CAAC,IAAI,0CAAE,IAAI,CAAC,CAAC;YACnF,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,WAAW,EAAE,6BAA6B,CAAC,WAAW,CAAC,CAAC;YACrF,MAAM,CAAC,KAAK,CAAC,MAAA,eAAe,CAAC,QAAQ,0CAAE,IAAI,EAAE,MAAA,4BAA4B,CAAC,QAAQ,0CAAE,IAAI,CAAC,CAAC;;KAC3F,CAAC,CAAC;IAEH,EAAE,CAAC,iBAAiB,EAAE;;YACpB,gCAAgC;YAChC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,WAAW,CAC/C,iBAAiB,EACjB,oBAAoB,CACrB,CAAC;QACJ,CAAC;KAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "sdk-type": "mgmt",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "A generated SDK for LoadTestClient.",
6
- "version": "1.0.0-alpha.20221214.1",
6
+ "version": "1.0.0-alpha.20221220.1",
7
7
  "engines": {
8
8
  "node": ">=14.0.0"
9
9
  },
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.33.7"
8
+ "packageVersion": "7.33.6"
9
9
  }
10
10
  ]
11
11
  }
@@ -1,4 +0,0 @@
1
- export declare const testPollingOptions: {
2
- updateIntervalInMs: number | undefined;
3
- };
4
- //# sourceMappingURL=loadtesting_example.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loadtesting_example.spec.d.ts","sourceRoot":"","sources":["../../test/loadtesting_example.spec.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,kBAAkB;;CAE9B,CAAC"}
@@ -1,108 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import { __asyncValues, __awaiter } from "tslib";
9
- import { env, Recorder, isPlaybackMode, } from "@azure-tools/test-recorder";
10
- import { createTestCredential } from "@azure-tools/test-credential";
11
- import { assert } from "chai";
12
- import { LoadTestClient } from "../src/loadTestClient";
13
- const replaceableVariables = {
14
- AZURE_CLIENT_ID: "azure_client_id",
15
- AZURE_CLIENT_SECRET: "azure_client_secret",
16
- AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
17
- SUBSCRIPTION_ID: "azure_subscription_id"
18
- };
19
- const recorderOptions = {
20
- envSetupForPlayback: replaceableVariables
21
- };
22
- export const testPollingOptions = {
23
- updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
24
- };
25
- describe("LoadTesting test", () => {
26
- let recorder;
27
- let subscriptionId;
28
- let client;
29
- let location;
30
- let resourceGroup;
31
- let loadTestName;
32
- beforeEach(function () {
33
- return __awaiter(this, void 0, void 0, function* () {
34
- recorder = new Recorder(this.currentTest);
35
- yield recorder.start(recorderOptions);
36
- subscriptionId = env.SUBSCRIPTION_ID || '';
37
- // This is an example of how the environment variables are used
38
- const credential = createTestCredential();
39
- client = new LoadTestClient(credential, subscriptionId, recorder.configureClientOptions({}));
40
- location = "eastus";
41
- resourceGroup = "myjstest";
42
- loadTestName = "myLoadTest";
43
- });
44
- });
45
- afterEach(function () {
46
- return __awaiter(this, void 0, void 0, function* () {
47
- yield recorder.stop();
48
- });
49
- });
50
- it("loadTests create test", function () {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- const res = yield client.loadTests.beginCreateOrUpdateAndWait(resourceGroup, loadTestName, {
53
- description: "This is new load test resource",
54
- location,
55
- tags: { team: "Dev Exp" }
56
- }, testPollingOptions);
57
- assert.equal(res.name, loadTestName);
58
- });
59
- });
60
- it("loadTests get test", function () {
61
- return __awaiter(this, void 0, void 0, function* () {
62
- const res = yield client.loadTests.get(resourceGroup, loadTestName);
63
- assert.equal(res.name, loadTestName);
64
- });
65
- });
66
- it("loadTests list test", function () {
67
- var e_1, _a;
68
- return __awaiter(this, void 0, void 0, function* () {
69
- const resArray = new Array();
70
- try {
71
- for (var _b = __asyncValues(client.loadTests.listByResourceGroup(resourceGroup)), _c; _c = yield _b.next(), !_c.done;) {
72
- let item = _c.value;
73
- resArray.push(item);
74
- }
75
- }
76
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
77
- finally {
78
- try {
79
- if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
80
- }
81
- finally { if (e_1) throw e_1.error; }
82
- }
83
- assert.equal(resArray.length, 1);
84
- });
85
- });
86
- it("loadTests delete test", function () {
87
- var e_2, _a;
88
- return __awaiter(this, void 0, void 0, function* () {
89
- const resArray = new Array();
90
- const res = yield client.loadTests.beginDeleteAndWait(resourceGroup, loadTestName);
91
- try {
92
- for (var _b = __asyncValues(client.loadTests.listByResourceGroup(resourceGroup)), _c; _c = yield _b.next(), !_c.done;) {
93
- let item = _c.value;
94
- resArray.push(item);
95
- }
96
- }
97
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
98
- finally {
99
- try {
100
- if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
101
- }
102
- finally { if (e_2) throw e_2.error; }
103
- }
104
- assert.equal(resArray.length, 0);
105
- });
106
- });
107
- });
108
- //# sourceMappingURL=loadtesting_example.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loadtesting_example.spec.js","sourceRoot":"","sources":["../../test/loadtesting_example.spec.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,OAAO,EACL,GAAG,EACH,QAAQ,EAGR,cAAc,GACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,oBAAoB,GAA2B;IAC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