@@ -19,9 +19,9 @@ describe("client list", () => {
19
19
for ( const client of clientList ) {
20
20
const serviceName = client . slice ( 7 ) ;
21
21
22
- let defaultEndpointResolver ;
23
- let namespace ;
24
- let model ;
22
+ let defaultEndpointResolver : any ;
23
+ let namespace : any ;
24
+ let model : any ;
25
25
26
26
// this may also work with dynamic async import() in a beforeAll() block,
27
27
// but needs more effort than using synchronous require().
@@ -41,7 +41,9 @@ for (const client of clientList) {
41
41
42
42
describe ( `client-${ serviceName } endpoint test cases` , ( ) => {
43
43
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 ;
45
47
const [ , tests ] = Object . entries ( service . traits ) . find ( ( [ k , v ] ) => k === "smithy.rules#endpointTests" ) as any ;
46
48
if ( tests ?. testCases ) {
47
49
runTestCases ( tests , service , defaultEndpointResolver , "" ) ;
@@ -106,8 +108,8 @@ async function runTestCase(
106
108
}
107
109
if ( isErrorExpectation ( expectation ) ) {
108
110
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, "" ) ;
111
113
if ( operationInputs ) {
112
114
for ( const operationInput of operationInputs ) {
113
115
const { operationName, operationParams = { } } = operationInput ;
0 commit comments