Skip to content

Commit 61505ca

Browse files
authored
test: fix TypeScript errors in endpoints-integration.spec.ts (#6372)
1 parent 366c61d commit 61505ca

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/endpoints-2.0/endpoints-integration.spec.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ describe("client list", () => {
1919
for (const client of clientList) {
2020
const serviceName = client.slice(7);
2121

22-
let defaultEndpointResolver;
23-
let namespace;
24-
let model;
22+
let defaultEndpointResolver: any;
23+
let namespace: any;
24+
let model: any;
2525

2626
// this may also work with dynamic async import() in a beforeAll() block,
2727
// but needs more effort than using synchronous require().
@@ -41,7 +41,9 @@ for (const client of clientList) {
4141

4242
describe(`client-${serviceName} endpoint test cases`, () => {
4343
if (defaultEndpointResolver && namespace && model) {
44-
const [, service] = Object.entries(model.shapes).find(([k, v]) => v?.["type"] === "service") as any;
44+
const [, service] = Object.entries(model.shapes).find(
45+
([k, v]) => typeof v === "object" && v !== null && "type" in v && v.type === "service"
46+
) as any;
4547
const [, tests] = Object.entries(service.traits).find(([k, v]) => k === "smithy.rules#endpointTests") as any;
4648
if (tests?.testCases) {
4749
runTestCases(tests, service, defaultEndpointResolver, "");
@@ -106,8 +108,8 @@ async function runTestCase(
106108
}
107109
if (isErrorExpectation(expectation)) {
108110
const { error } = expectation;
109-
const pass = (err) => err;
110-
const normalizeQuotes = (s) => s.replace(/`/g, "");
111+
const pass = (err: any) => err;
112+
const normalizeQuotes = (s: string) => s.replace(/`/g, "");
111113
if (operationInputs) {
112114
for (const operationInput of operationInputs) {
113115
const { operationName, operationParams = {} } = operationInput;

0 commit comments

Comments
 (0)