mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 15:36:25 +00:00
6ea0d5d6fb
Co-authored-by: Michael Kriese <michael.kriese@visualon.de> Co-authored-by: Sergei Zharinov <zharinov@users.noreply.github.com> Co-authored-by: Rhys Arkins <rhys@arkins.net>
24 lines
620 B
TypeScript
24 lines
620 B
TypeScript
import { getS3Client, parseS3Url } from './s3';
|
|
|
|
describe('util/s3', () => {
|
|
it('parses S3 URLs', () => {
|
|
expect(parseS3Url('s3://bucket/key/path')).toEqual({
|
|
Bucket: 'bucket',
|
|
Key: 'key/path',
|
|
});
|
|
});
|
|
|
|
it('returns null for non-S3 URLs', () => {
|
|
expect(parseS3Url('http://example.com/key/path')).toBeNull();
|
|
});
|
|
|
|
it('returns null for invalid URLs', () => {
|
|
expect(parseS3Url('thisisnotaurl')).toBeNull();
|
|
});
|
|
|
|
it('returns a singleton S3 client instance', () => {
|
|
const client1 = getS3Client();
|
|
const client2 = getS3Client();
|
|
expect(client1).toBe(client2);
|
|
});
|
|
});
|