renovate/lib/util/s3.spec.ts
Kenneth Jorgensen 6ea0d5d6fb
feat(maven): S3 Support (#14938)
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>
2022-05-04 05:59:14 +02:00

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);
});
});