Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joehoyle committed Mar 5, 2024
1 parent 25ff598 commit 78e568d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test-lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class TestResponseStream {
contentType: string | undefined;
body: string | Buffer | undefined;
headers: { [key: string]: string } = {};
metadata: any;

setContentType( type: string ): void {
this.contentType = type;
Expand All @@ -46,7 +47,9 @@ class TestResponseStream {
}
}
end(): void {

if ( this.metadata.headers['Content-Type'] ) {
this.contentType = this.metadata.headers['Content-Type'];
}
}
}

Expand All @@ -63,7 +66,8 @@ global.awslambda = {
* @param stream The response stream.
* @param metadata The metadata for the response.
*/
from( stream: ResponseStream, metadata ) : ResponseStream {
from( stream: TestResponseStream, metadata ) : TestResponseStream {
stream.metadata = metadata;
return stream;
},
},
Expand Down

0 comments on commit 78e568d

Please sign in to comment.