diff --git a/packages/techdocs-common/__mocks__/@azure/storage-blob.ts b/packages/techdocs-common/__mocks__/@azure/storage-blob.ts index 7157f9da60..4fc1e4c374 100644 --- a/packages/techdocs-common/__mocks__/@azure/storage-blob.ts +++ b/packages/techdocs-common/__mocks__/@azure/storage-blob.ts @@ -23,10 +23,11 @@ import path from 'path'; const rootDir = os.platform() === 'win32' ? 'C:\\rootDir' : '/rootDir'; /** - * @param sourceFile contains either / or \ as file separator depending upon OS. + * @param sourceFile Relative path to entity root dir. Contains either / or \ as file separator + * depending upon the OS. */ const checkFileExists = async (sourceFile: string): Promise => { - // sourceFile will always have / as file separator irrespective of OS since S3 expects /. + // sourceFile will always have / as file separator irrespective of OS since Azure expects /. // Normalize sourceFile to OS specific path before checking if file exists. const relativeFilePath = sourceFile.split(path.posix.sep).join(path.sep); const filePath = path.join(rootDir, sourceFile); diff --git a/packages/techdocs-common/__mocks__/@google-cloud/storage.ts b/packages/techdocs-common/__mocks__/@google-cloud/storage.ts index 9f19e8bf99..648aceadb4 100644 --- a/packages/techdocs-common/__mocks__/@google-cloud/storage.ts +++ b/packages/techdocs-common/__mocks__/@google-cloud/storage.ts @@ -21,10 +21,10 @@ type storageOptions = { }; /** - * @param sourceFile contains either / or \ as file separator depending upon OS. + * @param sourceFile Absolute path. Contains either / or \ as file separator depending upon the OS. */ const checkFileExists = async (sourceFile: string): Promise => { - // sourceFile will always have / as file separator irrespective of OS since S3 expects /. + // sourceFile will always have / as file separator irrespective of OS since GCS expects /. // Normalize sourceFile to OS specific path before checking if file exists. const filePath = sourceFile.split(path.posix.sep).join(path.sep); diff --git a/packages/techdocs-common/__mocks__/aws-sdk.ts b/packages/techdocs-common/__mocks__/aws-sdk.ts index 6957ea7430..0a50b0e792 100644 --- a/packages/techdocs-common/__mocks__/aws-sdk.ts +++ b/packages/techdocs-common/__mocks__/aws-sdk.ts @@ -22,7 +22,8 @@ import path from 'path'; const rootDir = os.platform() === 'win32' ? 'C:\\rootDir' : '/rootDir'; /** - * @param Key contains either / or \ as file separator depending upon OS. + * @param Key Relative path to entity root dir. Contains either / or \ as file separator + * depending upon the OS. */ const checkFileExists = async (Key: string): Promise => { // Key will always have / as file separator irrespective of OS since S3 expects /. diff --git a/packages/techdocs-common/src/stages/publish/awsS3.test.ts b/packages/techdocs-common/src/stages/publish/awsS3.test.ts index 0c2a33dc03..0696ec5b1a 100644 --- a/packages/techdocs-common/src/stages/publish/awsS3.test.ts +++ b/packages/techdocs-common/src/stages/publish/awsS3.test.ts @@ -16,8 +16,8 @@ import type { Entity, EntityName } from '@backstage/catalog-model'; import { ConfigReader } from '@backstage/config'; import mockFs from 'mock-fs'; -import * as os from 'os'; -import * as path from 'path'; +import os from 'os'; +import path from 'path'; import * as winston from 'winston'; import { AwsS3Publish } from './awsS3'; import { PublisherBase, TechDocsMetadata } from './types';