Skip to content

Commit

Permalink
WIP for checking test
Browse files Browse the repository at this point in the history
  • Loading branch information
CeEv committed Jul 25, 2024
1 parent d39c7f9 commit 62b43d1
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 34 deletions.
4 changes: 2 additions & 2 deletions apps/server/src/infra/s3-client/s3-client.adapter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('S3ClientAdapter', () => {
}).compile();

service = module.get(S3ClientAdapter);
client = module.get('S3_Client');
client = module.get(S3_CLIENT);
});

afterAll(async () => {
Expand Down Expand Up @@ -197,7 +197,7 @@ describe('S3ClientAdapter', () => {
return { file };
};

describe('WHEN file is created successfully', () => {
describe.only('WHEN file is created successfully', () => {

Check failure on line 200 in apps/server/src/infra/s3-client/s3-client.adapter.spec.ts

View workflow job for this annotation

GitHub Actions / nest_lint

describe.only not permitted
const setup = () => {
const { file } = createFile();
const { pathToFile } = createParameter();
Expand Down
5 changes: 4 additions & 1 deletion apps/server/src/infra/s3-client/s3-client.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
HeadObjectCommand,
HeadObjectCommandOutput,
ListObjectsV2Command,
PutObjectCommandInput,
S3Client,
ServiceOutputTypes,
} from '@aws-sdk/client-s3';
Expand Down Expand Up @@ -86,12 +87,14 @@ export class S3ClientAdapter {
try {
this.logger.debug({ action: 'create', params: { path, bucket: this.config.bucket } });

const req = {
const req: PutObjectCommandInput = {
Body: file.data,
Bucket: this.config.bucket,
Key: path,
ContentType: file.mimeType,
};

console.log(this.client);
const upload = new Upload({
client: this.client,
params: req,
Expand Down
6 changes: 1 addition & 5 deletions apps/server/src/shared/common/guards/type.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,7 @@ export class TypeGuard {

/** @return undefined if no object or key do not exists, otherwise the value of the key. */
static getValueFromObjectKey(value: unknown, key: string): unknown {
if (!TypeGuard.checkDefinedObject(value)) {
return undefined;
}

const result: unknown = (value as object)[key];
const result: unknown = TypeGuard.isDefinedObject(value) ? value[key] : undefined;

return result;
}
Expand Down
48 changes: 24 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"generate-client:etherpad": "node ./scripts/generate-client.js -u 'http://localhost:9001/api/openapi.json' -p 'apps/server/src/infra/etherpad-client/etherpad-api-client' -c 'openapitools-config.json'"
},
"dependencies": {
"@aws-sdk/lib-storage": "^3.616.0",
"@aws-sdk/lib-storage": "^3.617.0",
"@feathersjs/adapter-commons": "^5.0.12",
"@feathersjs/authentication": "^5.0.12",
"@feathersjs/authentication-local": "^5.0.12",
Expand Down Expand Up @@ -263,7 +263,7 @@
"yjs": "^13.6.11"
},
"devDependencies": {
"@aws-sdk/client-s3": "^3.352.0",
"@aws-sdk/client-s3": "^3.617.0",
"@faker-js/faker": "^8.0.2",
"@feathersjs/adapter-tests": "^5.0.12",
"@golevelup/ts-jest": "^0.3.4",
Expand Down

0 comments on commit 62b43d1

Please sign in to comment.