Skip to content

Commit

Permalink
cli-test: add ability to invoke arbitrary CLI commands (#1798)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fil Maj authored May 28, 2024
1 parent 65b2332 commit a0e01c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/cli-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ This package exports the following:

1. `SlackCLI` - an object containing a variety of methods to interact with the CLI
- methods are named after [Slack CLI commands][commands], e.g. `SlackCLI.deploy()`
2. `SlackTracerId` - trace IDs to verify CLI command output
2. `SlackCLIProcess` - a class that can be instantiated that exposes the ability to run arbitrary commands, with optional global flags as well as command-specific flags.
3. `SlackTracerId` - trace IDs to verify CLI command output
- see available exported IDs on `SlackTracerId` object
- to enable the CLI to show this output, any CLI commands executed by this library are invoked with the environment variable set: `SLACK_TEST_TRACE=true`

Expand All @@ -48,7 +49,7 @@ describe('Login with the CLI', () => {
const loginChallengeResult = await SlackCLI.loginNoPrompt();

// Submit auth ticket in Slack UI
const challenge = await this.submitCLIAuthTicket(
const challenge = await submitCLIAuthTicket(
loginUrlToMyWorkspace,
loginChallengeResult.authTicketSlashCommand
);
Expand Down
3 changes: 2 additions & 1 deletion packages/cli-test/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export { SlackCLI } from './cli';
export { SlackCLIProcess } from './cli/cli-process';
export { SlackTracerId, SlackProduct } from './utils/constants';

// Check for cli binary path
if (!process.env.SLACK_CLI_PATH) {
throw new Error('SlackCliLib: SLACK_CLI_PATH is not set');
throw new Error('Environment variable `SLACK_CLI_PATH` is not set!');
}

0 comments on commit a0e01c5

Please sign in to comment.