Skip to content

Commit a0e01c5

Browse files
author
Fil Maj
authored
cli-test: add ability to invoke arbitrary CLI commands (#1798)
1 parent 65b2332 commit a0e01c5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/cli-test/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ This package exports the following:
3434

3535
1. `SlackCLI` - an object containing a variety of methods to interact with the CLI
3636
- methods are named after [Slack CLI commands][commands], e.g. `SlackCLI.deploy()`
37-
2. `SlackTracerId` - trace IDs to verify CLI command output
37+
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.
38+
3. `SlackTracerId` - trace IDs to verify CLI command output
3839
- see available exported IDs on `SlackTracerId` object
3940
- 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`
4041

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

5051
// Submit auth ticket in Slack UI
51-
const challenge = await this.submitCLIAuthTicket(
52+
const challenge = await submitCLIAuthTicket(
5253
loginUrlToMyWorkspace,
5354
loginChallengeResult.authTicketSlashCommand
5455
);

packages/cli-test/src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
export { SlackCLI } from './cli';
2+
export { SlackCLIProcess } from './cli/cli-process';
23
export { SlackTracerId, SlackProduct } from './utils/constants';
34

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

0 commit comments

Comments
 (0)