1+ import { setTimeout } from 'node:timers/promises' ;
12import type { LambdaInterface } from '@aws-lambda-powertools/commons/types' ;
23import type { Context } from 'aws-lambda' ;
34import { describe , expect , it } from 'vitest' ;
@@ -30,6 +31,7 @@ describe('Decorator: parser', () => {
3031 class TestClass implements LambdaInterface {
3132 @parser ( { schema : extendedSchema } )
3233 public async handler ( event : event , _context : Context ) : Promise < event > {
34+ await setTimeout ( 1 ) ; // simulate some processing time
3335 return event ;
3436 }
3537
@@ -38,6 +40,7 @@ describe('Decorator: parser', () => {
3840 event : z . infer < typeof schema > ,
3941 _context : Context
4042 ) : Promise < unknown > {
43+ await setTimeout ( 1 ) ; // simulate some processing time
4144 return this . anotherMethod ( event ) ;
4245 }
4346
@@ -49,6 +52,7 @@ describe('Decorator: parser', () => {
4952 event : ParsedResult < unknown , event > ,
5053 _context : Context
5154 ) : Promise < ParsedResult < unknown , event > > {
55+ await setTimeout ( 1 ) ; // simulate some processing time
5256 return event ;
5357 }
5458
@@ -61,10 +65,11 @@ describe('Decorator: parser', () => {
6165 event : ParsedResult < event , event > ,
6266 _context : Context
6367 ) : Promise < ParsedResult > {
68+ await setTimeout ( 1 ) ; // simulate some processing time
6469 return event ;
6570 }
6671
67- private async anotherMethod ( event : unknown ) : Promise < unknown > {
72+ private anotherMethod ( event : unknown ) : unknown {
6873 return event ;
6974 }
7075 }
0 commit comments