diff --git a/src/backends/s3/create-s3-client.ts b/src/backends/s3/create-s3-client.ts index a0bdb04..d2b18ed 100644 --- a/src/backends/s3/create-s3-client.ts +++ b/src/backends/s3/create-s3-client.ts @@ -32,9 +32,5 @@ export function createS3Client(uri: string): S3Client { process.env.AWS_ENDPOINT_URL_S3 ?? process.env.AWS_ENDPOINT_URL; - if (config.endpoint) { - throw new Error(JSON.stringify(config)); - } - return new S3Client(config); } diff --git a/src/backends/s3/mock-s3.test.ts b/src/backends/s3/mock-s3.test.ts index cdb4cfb..e7088a0 100644 --- a/src/backends/s3/mock-s3.test.ts +++ b/src/backends/s3/mock-s3.test.ts @@ -9,14 +9,15 @@ import { } from 'bun:test'; import { createS3Fs } from './s3'; -mock.module('./create-s3-client', () => { - const fn = jest.fn(); - return { createS3Client: fn }; -}); - describe('s3Fs with mocked client', () => { + let mockSend: jest.Mock; + beforeEach(async () => { + mock.module('./create-s3-client', () => { + const fn = jest.fn(); + return { createS3Client: fn }; + }); const { createS3Client } = await import('./create-s3-client'); mockSend = jest.fn(); (createS3Client as jest.Mock).mockReturnValue({