1
+ import { setTimeout } from 'node:timers/promises' ;
1
2
import type { LambdaInterface } from '@aws-lambda-powertools/commons/types' ;
2
3
import type { Context } from 'aws-lambda' ;
3
4
import { describe , expect , it } from 'vitest' ;
@@ -30,6 +31,7 @@ describe('Decorator: parser', () => {
30
31
class TestClass implements LambdaInterface {
31
32
@parser ( { schema : extendedSchema } )
32
33
public async handler ( event : event , _context : Context ) : Promise < event > {
34
+ await setTimeout ( 1 ) ; // simulate some processing time
33
35
return event ;
34
36
}
35
37
@@ -38,6 +40,7 @@ describe('Decorator: parser', () => {
38
40
event : z . infer < typeof schema > ,
39
41
_context : Context
40
42
) : Promise < unknown > {
43
+ await setTimeout ( 1 ) ; // simulate some processing time
41
44
return this . anotherMethod ( event ) ;
42
45
}
43
46
@@ -49,6 +52,7 @@ describe('Decorator: parser', () => {
49
52
event : ParsedResult < unknown , event > ,
50
53
_context : Context
51
54
) : Promise < ParsedResult < unknown , event > > {
55
+ await setTimeout ( 1 ) ; // simulate some processing time
52
56
return event ;
53
57
}
54
58
@@ -61,10 +65,11 @@ describe('Decorator: parser', () => {
61
65
event : ParsedResult < event , event > ,
62
66
_context : Context
63
67
) : Promise < ParsedResult > {
68
+ await setTimeout ( 1 ) ; // simulate some processing time
64
69
return event ;
65
70
}
66
71
67
- private async anotherMethod ( event : unknown ) : Promise < unknown > {
72
+ private anotherMethod ( event : unknown ) : unknown {
68
73
return event ;
69
74
}
70
75
}
0 commit comments