Skip to content

Commit

Permalink
cli-test: ensure skipping update is truly the default (#1792)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fil Maj authored May 23, 2024
1 parent 793c6a3 commit 0fedf14
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/cli-test/src/cli/cli-process.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ describe('SlackCLIProcess class', () => {
cmd = new SlackCLIProcess('help', { skipUpdate: true });
await cmd.execAsync();
sandbox.assert.calledWithMatch(runAsyncSpy, '--skip-update');
runAsyncSpy.resetHistory();
cmd = new SlackCLIProcess('help', {}); // empty global options; so undefined skipUpdate option
await cmd.execAsync();
sandbox.assert.calledWithMatch(runAsyncSpy, '--skip-update');
});
});
describe('command options', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-test/src/cli/cli-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class SlackCLIProcess {
if (opts.qa || opts.dev) {
cmd += ' --slackdev';
}
if (opts.skipUpdate) {
if (opts.skipUpdate || opts.skipUpdate === undefined) {
cmd += ' --skip-update';
}
if (opts.team) {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-test/src/cli/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const shell = {
* - Execute child process with the command
* - Wait for the command to complete and return the standard output
* @param command cli command, e.g. <cli> --version or any shell command
* @param skipUpdate skip auto update notification
* @param shellOpts various shell spawning options available to customize
* @returns command stdout
*/
runCommandSync: function runSyncCommand(
Expand Down

0 comments on commit 0fedf14

Please sign in to comment.