Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
vegeris committed Jun 17, 2024
1 parent d368a8a commit 753a4de
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/cli-test/src/cli/cli-process.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,25 @@ describe('SlackCLIProcess class', () => {

describe('CLI flag handling', () => {
describe('global options', () => {
it('should map qa or dev options to --slackdev', async () => {
let cmd = new SlackCLIProcess('help', { qa: true });
it('should map dev option to --slackdev', async () => {
let cmd = new SlackCLIProcess('help', { dev: true });
await cmd.execAsync();
sandbox.assert.calledWithMatch(spawnProcessSpy, '--slackdev');
spawnProcessSpy.resetHistory();
cmd = new SlackCLIProcess('help');
await cmd.execAsync();
sandbox.assert.neverCalledWithMatch(spawnProcessSpy, '--slackdev');
spawnProcessSpy.resetHistory();
cmd = new SlackCLIProcess('help', { dev: true });
});
it('should map qa option to QA host', async () => {
let cmd = new SlackCLIProcess('help', { qa: true });
await cmd.execAsync();
sandbox.assert.calledWithMatch(spawnProcessSpy, '--slackdev');
sandbox.assert.calledWithMatch(spawnProcessSpy, '--apihost qa.slack.com');
spawnProcessSpy.resetHistory();
cmd = new SlackCLIProcess('help');
await cmd.execAsync();
sandbox.assert.neverCalledWithMatch(spawnProcessSpy, '--apihost qa.slack.com');
spawnProcessSpy.resetHistory();
});
it('should default to passing --skip-update but allow overriding that', async () => {
let cmd = new SlackCLIProcess('help');
Expand Down

0 comments on commit 753a4de

Please sign in to comment.