🐛 When we are creating path for the files to store them in S3 (#583)
* 🐛When we are creating path for the files to store them in S3, sometimes it's with trailing "/" and sometimes without
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
import StorageService from "../../../../../../src/core/platform/services/storage/storage-service";
|
||||
import { jest } from "@jest/globals";
|
||||
import { TdriveServiceConfiguration } from "../../../../../../src/core/platform/framework";
|
||||
|
||||
describe("The StorageService", () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
test("StorageService constructor should throw an exception for S3 storage configuration when home directory starts with trailing slash", async () => {
|
||||
//when
|
||||
expect(() => {
|
||||
new StorageService({
|
||||
configuration: {
|
||||
get(name: string){
|
||||
if (name === "type") return "S3";
|
||||
if (name === "S3.homeDirectory") return "/my_mock_folder";
|
||||
return null;
|
||||
}
|
||||
} as TdriveServiceConfiguration,
|
||||
name: "MockStorageService",
|
||||
})
|
||||
}).toThrow("For S3 connector home directory MUST NOT start with '/'");
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user