Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli-test: add ability to invoke arbitrary CLI commands #1798

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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!');
}
Loading