Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
joehoyle committed Feb 29, 2024
1 parent be69efa commit 8a3a703
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18.x
- run: env
- run: npm install
- run: npx jest
env:
Expand Down
4 changes: 2 additions & 2 deletions tests/test-lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ global.awslambda = {
},
HttpResponseStream: {
/**
* @param stream
* @param metadata
* @param stream The response stream.
* @param metadata The metadata for the response.
*/
from( stream: ResponseStream, metadata ) : ResponseStream {
return stream;
Expand Down
15 changes: 6 additions & 9 deletions tests/test-private-upload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetObjectCommand, S3Client, S3ClientConfig } from '@aws-sdk/client-s3';
import { GetObjectCommand, S3Client } from '@aws-sdk/client-s3';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
import { test, expect } from '@jest/globals';
import { MiddlewareType } from '@smithy/types';
Expand All @@ -9,15 +9,12 @@ import { Args } from '../src/lib';
/**
* Presign a URL for a given key.
* @param key
* @returns {Promise<string>}
* @returns {Promise<Args>} The presigned params
*/
async function getPresignedUrlParams( key: string ) : Promise<Args> {
const client = new S3Client(
{
region: process.env.S3_REGION,
bucket: process.env.S3_BUCKET,
} as S3ClientConfig
);
const client = new S3Client( {
region: process.env.S3_REGION,
} );
const command = new GetObjectCommand( {
Bucket: process.env.S3_BUCKET,
Key: key,
Expand All @@ -42,7 +39,7 @@ async function getPresignedUrlParams( key: string ) : Promise<Args> {
const presignedUrl = new URL( await getSignedUrl( client, command, {
expiresIn: 60,
} ) );
// console.log( presignedUrl );

let queryStringParameters: Args = {};
presignedUrl.searchParams.forEach( ( value, key ) => {
queryStringParameters[ key as keyof Args ] = value;
Expand Down

0 comments on commit 8a3a703

Please sign in to comment.