Skip to content

Commit

Permalink
fix(cli): Change to require either app or pipeline (#2907)
Browse files Browse the repository at this point in the history
* Change to require either app or pipeline

* Add test for requiring app or pipeline

remove .only

Remove tsheredoc import
  • Loading branch information
eablack authored Jul 2, 2024
1 parent 33ba7a7 commit 3914169
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cli/src/commands/ci/config/set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class CiConfigSet extends Command {
static flags = {
app: flags.app(),
remote: flags.remote(),
pipeline: flags.pipeline({required: true}),
pipeline: flags.pipeline({exactlyOne: ['pipeline', 'app']}),
}

static strict = false
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/test/unit/commands/ci/config/set.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,12 @@ describe('heroku ci:config:set', function () {
expect(error.message).to.equal('Usage: heroku ci:config:set KEY1 [KEY2 ...]\nMust specify KEY to set.')
})
.it('errors with example of valid args')

test
.stderr()
.command(['ci:config:set', '--', `${key}=${value}`])
.catch(error => {
expect(error.message).to.include('Exactly one of the following must be provided: --app, --pipeline')
})
.it('errors with explanation of required flags')
})

0 comments on commit 3914169

Please sign in to comment.