Skip to content

Commit

Permalink
fix: unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Lisi Linhart committed Dec 15, 2023
1 parent eef666a commit 0b7331f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/commands/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default class CreateStoryblokAppCommand extends Command {
if (isValidRegion) {
selectedRegion = Object.values(regions).find(r => r.value === spaceRegion)
} else {
throw new Error(`Please provide a valid region via '-r' parameter : ${Object.keys(regions).join(', ')}`)
throw new Error(`Please provide a valid region via '-r' parameter : ${possibleRegionValues.join(', ')}`)
}

let regionParam = ''
Expand Down
4 changes: 2 additions & 2 deletions test/commands/default.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ describe('Launch command', () => {

test
.stdout({print: false})
.command(['default', '--folder=mytestdir', '--packagemanager=npm', '--framework=astro', '--region=EU', '--key=TEST'])
.command(['default', '--folder=mytestdir', '--packagemanager=npm', '--framework=astro', '--region=YOLO', '--key=TEST'])
.it('with wrong region', async ctx => {
expect(ctx.stdout).to.contain('the space is located in a region outside')
expect(ctx.stdout).to.contain('Please provide a valid region')
})
})

0 comments on commit 0b7331f

Please sign in to comment.