UNPKG

@itwin/object-storage-tests-backend

Version:

Tests for generic storage packages

85 lines 5.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ const object_storage_core_1 = require("@itwin/object-storage-core"); const Config_1 = require("./Config"); const DownloadTests_1 = require("./test-templates/DownloadTests"); const UploadTests_1 = require("./test-templates/UploadTests"); const { frontendStorage, serverStorage } = Config_1.config; describe(`${object_storage_core_1.FrontendStorage.name}: ${frontendStorage.constructor.name}`, () => { describe("PresignedUrlProvider", () => { describe(`${frontendStorage.upload.name}() & ${serverStorage.getUploadUrl.name}()`, () => { it("should upload a file from buffer to URL", async () => { await UploadTests_1.testUploadFromBufferToUrl(frontendStorage); }); it("should upload a file from stream to URL", async () => { await UploadTests_1.testUploadFromStreamToUrl(frontendStorage); }); it("should upload a file with relative dir from buffer to URL", async () => { await UploadTests_1.testUploadWithRelativeDirFromBufferToUrl(frontendStorage); }); it("should upload a file with relative dir from stream to URL", async () => { await UploadTests_1.testUploadWithRelativeDirFromStreamToUrl(frontendStorage); }); it("should upload a file with metadata from buffer to URL", async () => { await UploadTests_1.testUploadWithMetadataFromBufferToUrl(frontendStorage); }); it("should upload a file with metadata from stream to URL", async () => { await UploadTests_1.testUploadWithMetadataFromStreamToUrl(frontendStorage); }); }); describe(`${frontendStorage.download.name}() & ${serverStorage.getDownloadUrl.name}()`, () => { it(`should download a file to buffer from URL`, async () => { await DownloadTests_1.testDownloadFromUrlToBuffer(frontendStorage); }); it(`should download a file to stream from URL`, async () => { await DownloadTests_1.testDownloadFromUrlToStream(frontendStorage); }); }); }); describe("TransferConfigProvider", () => { describe(`${frontendStorage.upload.name}() & ${serverStorage.getUploadConfig.name}()`, () => { it(`should upload a file from buffer using transfer config`, async () => { await UploadTests_1.testUploadFromBufferWithConfig(frontendStorage); }); it(`should upload a file from stream using transfer config`, async () => { await UploadTests_1.testUploadFromStreamWithConfig(frontendStorage); }); it(`should upload a file with relative directory from buffer using transfer config`, async () => { await UploadTests_1.testUploadWithRelativeDirFromBufferWithConfig(frontendStorage); }); it(`should upload a file with relative directory from stream using transfer config`, async () => { await UploadTests_1.testUploadWithRelativeDirFromStreamWithConfig(frontendStorage); }); it(`should upload a file from buffer with metadata using transfer config`, async () => { await UploadTests_1.testUploadWithMetadataFromBufferWithConfig(frontendStorage); }); it(`should upload a file from stream with metadata using transfer config`, async () => { await UploadTests_1.testUploadWithMetadataFromStreamWithConfig(frontendStorage); }); }); describe(`${frontendStorage.uploadInMultipleParts.name}() & ${serverStorage.getUploadConfig.name}()`, () => { it(`should upload a file from stream in multiple parts`, async () => { await UploadTests_1.testMultipartUploadFromStream(frontendStorage); }); it(`should upload a file with relative directory from stream in multiple parts`, async () => { await UploadTests_1.testMultipartUploadWithRelativeDirFromStream(frontendStorage); }); it(`should upload a file from stream with metadata in multiple parts`, async () => { await UploadTests_1.testMultipartUploadWithMetadataFromStream(frontendStorage); }); }); describe(`${frontendStorage.download.name}() & ${serverStorage.getDownloadConfig.name}()`, () => { it(`should download a file to buffer using transfer config`, async () => { await DownloadTests_1.testDownloadToBufferWithConfig(frontendStorage); }); it(`should download a file to stream using transfer config`, async () => { await DownloadTests_1.testDownloadToStreamWithConfig(frontendStorage); }); }); }); }); //# sourceMappingURL=FrontendStorage.test.js.map