@@ -27,7 +27,7 @@ describe('Parser Decorator', () => {
27
27
public async handler (
28
28
event : TestEvent ,
29
29
_context : Context
30
- ) : Promise < unknown > {
30
+ ) : Promise < TestEvent > {
31
31
return event ;
32
32
}
33
33
@@ -60,7 +60,7 @@ describe('Parser Decorator', () => {
60
60
safeParse : true ,
61
61
} )
62
62
public async handlerWithSchemaAndSafeParse (
63
- event : ParsedResult < TestEvent , TestEvent > ,
63
+ event : ParsedResult < unknown , TestEvent > ,
64
64
_context : Context
65
65
) : Promise < ParsedResult > {
66
66
return event ;
@@ -99,9 +99,7 @@ describe('Parser Decorator', () => {
99
99
testEvent . detail = customPayload ;
100
100
101
101
const resp = await lambda . handlerWithSchemaAndEnvelope (
102
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
103
- // @ts -ignore
104
- testEvent ,
102
+ testEvent as unknown as TestEvent ,
105
103
{ } as Context
106
104
) ;
107
105
@@ -130,9 +128,7 @@ describe('Parser Decorator', () => {
130
128
testEvent . detail = customPayload ;
131
129
132
130
const resp = await lambda . handlerWithParserCallsAnotherMethod (
133
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
134
- // @ts -ignore
135
- testEvent ,
131
+ testEvent as unknown as TestEvent ,
136
132
{ } as Context
137
133
) ;
138
134
@@ -143,9 +139,7 @@ describe('Parser Decorator', () => {
143
139
const testEvent = generateMock ( TestSchema ) ;
144
140
145
141
const resp = await lambda . handlerWithSchemaAndSafeParse (
146
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
147
- // @ts -ignore
148
- testEvent ,
142
+ testEvent as unknown as ParsedResult < unknown , TestEvent > ,
149
143
{ } as Context
150
144
) ;
151
145
@@ -157,9 +151,10 @@ describe('Parser Decorator', () => {
157
151
158
152
it ( 'should parse event with schema and safeParse and return error' , async ( ) => {
159
153
expect (
160
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
161
- // @ts -ignore
162
- await lambda . handlerWithSchemaAndSafeParse ( { foo : 'bar' } , { } as Context )
154
+ await lambda . handlerWithSchemaAndSafeParse (
155
+ { foo : 'bar' } as unknown as ParsedResult < unknown , TestEvent > ,
156
+ { } as Context
157
+ )
163
158
) . toEqual ( {
164
159
error : expect . any ( ParseError ) ,
165
160
success : false ,
@@ -173,9 +168,7 @@ describe('Parser Decorator', () => {
173
168
event . detail = testEvent ;
174
169
175
170
const resp = await lambda . harndlerWithEnvelopeAndSafeParse (
176
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
177
- // @ts -ignore
178
- event ,
171
+ event as unknown as ParsedResult < TestEvent , TestEvent > ,
179
172
{ } as Context
180
173
) ;
181
174
@@ -188,9 +181,7 @@ describe('Parser Decorator', () => {
188
181
it ( 'should parse event with envelope and safeParse and return error' , async ( ) => {
189
182
expect (
190
183
await lambda . harndlerWithEnvelopeAndSafeParse (
191
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
192
- // @ts -ignore
193
- { foo : 'bar' } ,
184
+ { foo : 'bar' } as unknown as ParsedResult < TestEvent , TestEvent > ,
194
185
{ } as Context
195
186
)
196
187
) . toEqual ( {
0 commit comments