fixes
This commit is contained in:
@@ -10,8 +10,8 @@ import { UploadPartCommand, CompleteMultipartUploadCommand, CreateMultipartUploa
|
||||
import { mockClient } from 'aws-sdk-client-mock';
|
||||
import { GlobalModule } from '@/GlobalModule.js';
|
||||
import { CoreModule } from '@/core/CoreModule.js';
|
||||
import { S3Service } from '@/core/S3Service';
|
||||
import { Meta } from '@/models';
|
||||
import { S3Service } from '@/core/S3Service.js';
|
||||
import { MiMeta } from '@/models/index.js';
|
||||
import type { TestingModule } from '@nestjs/testing';
|
||||
|
||||
describe('S3Service', () => {
|
||||
@@ -40,7 +40,7 @@ describe('S3Service', () => {
|
||||
test('upload a file', async () => {
|
||||
s3Mock.on(PutObjectCommand).resolves({});
|
||||
|
||||
await s3Service.upload({ objectStorageRegion: 'us-east-1' } as Meta, {
|
||||
await s3Service.upload({ objectStorageRegion: 'us-east-1' } as MiMeta, {
|
||||
Bucket: 'fake',
|
||||
Key: 'fake',
|
||||
Body: 'x',
|
||||
@@ -52,7 +52,7 @@ describe('S3Service', () => {
|
||||
s3Mock.on(UploadPartCommand).resolves({ ETag: '1' });
|
||||
s3Mock.on(CompleteMultipartUploadCommand).resolves({ Bucket: 'fake', Key: 'fake' });
|
||||
|
||||
await s3Service.upload({} as Meta, {
|
||||
await s3Service.upload({} as MiMeta, {
|
||||
Bucket: 'fake',
|
||||
Key: 'fake',
|
||||
Body: 'x'.repeat(8 * 1024 * 1024 + 1), // デフォルトpartSizeにしている 8 * 1024 * 1024 を越えるサイズ
|
||||
@@ -62,7 +62,7 @@ describe('S3Service', () => {
|
||||
test('upload a file error', async () => {
|
||||
s3Mock.on(PutObjectCommand).rejects({ name: 'Fake Error' });
|
||||
|
||||
await expect(s3Service.upload({ objectStorageRegion: 'us-east-1' } as Meta, {
|
||||
await expect(s3Service.upload({ objectStorageRegion: 'us-east-1' } as MiMeta, {
|
||||
Bucket: 'fake',
|
||||
Key: 'fake',
|
||||
Body: 'x',
|
||||
@@ -72,7 +72,7 @@ describe('S3Service', () => {
|
||||
test('upload a large file error', async () => {
|
||||
s3Mock.on(UploadPartCommand).rejects();
|
||||
|
||||
await expect(s3Service.upload({} as Meta, {
|
||||
await expect(s3Service.upload({} as MiMeta, {
|
||||
Bucket: 'fake',
|
||||
Key: 'fake',
|
||||
Body: 'x'.repeat(8 * 1024 * 1024 + 1), // デフォルトpartSizeにしている 8 * 1024 * 1024 を越えるサイズ
|
||||
|
Reference in New Issue
Block a user