Skip to content

Commit

Permalink
add env to prevent fail
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenvandermeulen committed Aug 14, 2023
1 parent 9b34172 commit 550f94c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import {getRepoNames} from '../src/main'

describe('getRepoNames', () => {
it('should fetch repository names for the given organization', async () => {
process.env = {
GH_ORG: 'myorg',
GH_API_KEY: 'apikey',
AWS_BUCKET_NAME: 'bucket',
AWS_BUCKET_REGION: 'region',
AWS_ACCESS_KEY: 'accesskey',
AWS_SECRET_KEY: 'secretkey'
}

const organization = 'testOrg'

const repoNames = await getRepoNames(organization)
Expand All @@ -10,6 +19,15 @@ describe('getRepoNames', () => {
})

it('should handle errors when fetching repository names', async () => {
process.env = {
GH_ORG: 'myorg',
GH_API_KEY: 'apikey',
AWS_BUCKET_NAME: 'bucket',
AWS_BUCKET_REGION: 'region',
AWS_ACCESS_KEY: 'accesskey',
AWS_SECRET_KEY: 'secretkey'
}

const organization = 'testOrgthatdoesnotexist'

await expect(getRepoNames(organization)).rejects.toThrowError(
Expand Down

0 comments on commit 550f94c

Please sign in to comment.