Skip to content

Commit

Permalink
pipeline test
Browse files Browse the repository at this point in the history
  • Loading branch information
ricsam committed Dec 12, 2024
1 parent 1d53461 commit fde6b8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 0 additions & 4 deletions src/backends/s3/create-s3-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
11 changes: 6 additions & 5 deletions src/backends/s3/mock-s3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit fde6b8a

Please sign in to comment.