Skip to content

Commit 3721e61

Browse files
authored
[Cosmos] Fix strictness issues in multiregion.spec.ts (#20228)
* fix strictness issue in test/public/integration/multiregion.spec.ts * update RequestContext type for context * prettier * update tsconfig.strict.json * update multiregion + tsconfig.strict.json
1 parent 921810a commit 3721e61

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

sdk/cosmosdb/cosmos/test/public/integration/multiregion.spec.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import assert from "assert";
44
import { Suite } from "mocha";
55

6-
import { CosmosClient } from "../../../src";
6+
import { CosmosClient, RequestContext } from "../../../src";
77
import { masterKey } from "../common/_fakeTestSecrets";
88
import { PluginOn, PluginConfig, CosmosClientOptions } from "../../../src";
99

@@ -127,9 +127,11 @@ describe("Multi-region tests", function (this: Suite) {
127127
const plugins: PluginConfig[] = [
128128
{
129129
on: PluginOn.request,
130-
plugin: async (context) => {
130+
plugin: async (context: RequestContext) => {
131131
const response = responses[requestIndex];
132-
lastEndpointCalled = context.endpoint;
132+
if (context.endpoint) {
133+
lastEndpointCalled = context.endpoint;
134+
}
133135
requestIndex++;
134136
if (response.code > 400) {
135137
throw response;
@@ -168,9 +170,11 @@ describe("Multi-region tests", function (this: Suite) {
168170
const plugins: PluginConfig[] = [
169171
{
170172
on: PluginOn.request,
171-
plugin: async (context) => {
173+
plugin: async (context: RequestContext) => {
172174
const response = responses[requestIndex];
173-
lastEndpointCalled = context.endpoint;
175+
if (context.endpoint) {
176+
lastEndpointCalled = context.endpoint;
177+
}
174178
requestIndex++;
175179
if (response.code > 400) {
176180
throw response;

0 commit comments

Comments
 (0)