Skip to content

Commit

Permalink
test: fix setupAWSEnvs for github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
msudgh committed Feb 9, 2024
1 parent 0167594 commit 02d3fac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
createValidInputFixtureWithTags,
sampleStorage,
} from './schemas/input.fixture'
import { setupEnvs } from './setupEnvs'
import { setupAWSEnvs } from './setupAWSEnvs'
import SyncCloudStorage from '../src'
import { InvalidConfigError } from '../src/errors'
import { createStorage, deleteStorage } from '../src/providers/s3/buckets'
Expand Down Expand Up @@ -41,7 +41,7 @@ const setupStorage = async (client: S3Client, storage: Storage) => {

describe('SyncCloudStorage', () => {
beforeAll(async () => {
await setupEnvs()
await setupAWSEnvs()
})

describe('Constructor Related Tests', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/setupEnvs.ts → test/setupAWSEnvs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const checkEnvVariables = (env: NodeJS.ProcessEnv) => {
return env.AWS_REGION && env.AWS_ACCESS_KEY_ID && env.AWS_SECRET_ACCESS_KEY
}

export const setupEnvs = async (): Promise<void> => {
export const setupAWSEnvs = async (): Promise<void> => {
const { credentialsFile, configFile } = await loadSharedConfigFiles({
ignoreCache: true,
})
Expand All @@ -17,7 +17,7 @@ export const setupEnvs = async (): Promise<void> => {
const credentials = credentialsFile[profile]
const config = configFile[profile]

if (!credentials && !config && checkEnvVariables(process.env)) {
if (!credentials || checkEnvVariables(process.env)) {
logger.info(
"AWS Region & Credentials not found in '~/.aws/credentials & '~/.aws/config'!"
)
Expand Down

0 comments on commit 02d3fac

Please sign in to comment.