Kui API Documentation - v11.0.0 / @kui-shell/test / CLI
@kui-shell/test.CLI
- command
- commandInSplit
- exitCode
- expandLast
- expandNth
- expectInput
- expectInputContext
- expectPriorInput
- getTextContent
- grabFocus
- lastBlock
- makeCustom
- nOfCurrentBlock
- paste
- waitForRepl
- waitForSession
• timeout: number
packages/test/src/api/cli.ts:24
• waitTimeout: number
packages/test/src/api/cli.ts:25
▸ Const command(cmd, app, noNewline?, noCopyPaste?, noFocus?, block?, currentPrompt?): Promise<{ app: Application = app; count: number }>
Execute a CLI command, and return the data-input-count of that command
| Name | Type | Default value |
|---|---|---|
cmd |
string |
undefined |
app |
Application |
undefined |
noNewline |
boolean |
false |
noCopyPaste |
boolean |
undefined |
noFocus |
boolean |
false |
block |
string |
undefined |
currentPrompt |
string |
undefined |
Promise<{ app: Application = app; count: number }>
packages/test/src/api/cli.ts:56
▸ Const commandInSplit(cmd, app, splitIndex): Promise<{ app: Application = app; count: number } & { splitIndex: number }>
Execute the given command in the given split
| Name | Type |
|---|---|
cmd |
string |
app |
Application |
splitIndex |
number |
Promise<{ app: Application = app; count: number } & { splitIndex: number }>
packages/test/src/api/cli.ts:102
▸ Const exitCode(statusCode): string | number
Exit code code for the given http status code; this is an identity function; for headless mode, there is the -256 part. See headless.js for the analogous headless implementation.
| Name | Type |
|---|---|
statusCode |
string | number |
string | number
packages/test/src/api/cli.ts:179
▸ expandLast(app, splitIndex?, N?): Promise<void>
Click to expand the last replayed sample output
| Name | Type | Default value |
|---|---|---|
app |
Application |
undefined |
splitIndex |
number |
1 |
N |
number |
1 |
Promise<void>
packages/test/src/api/cli.ts:244
▸ expandNth(app, N, splitIndex?): Promise<void>
Click to expand the last replayed sample output
| Name | Type | Default value |
|---|---|---|
app |
Application |
undefined |
N |
number |
undefined |
splitIndex |
number |
1 |
Promise<void>
packages/test/src/api/cli.ts:237
▸ Const expectInput(selector, expectedText): (app: Application) => Promise<Application>
| Name | Type |
|---|---|
selector |
string |
expectedText |
string |
fn
▸ (app): Promise<Application>
| Name | Type |
|---|---|
app |
Application |
Promise<Application>
packages/test/src/api/cli.ts:181
▸ expectInputContext(res, N, expectedText, exact?): Promise<boolean>
text repl input context text
| Name | Type | Default value |
|---|---|---|
res |
AppAndCount |
undefined |
N |
number |
undefined |
expectedText |
string |
undefined |
exact |
boolean |
false |
Promise<boolean>
packages/test/src/api/cli.ts:193
▸ Const expectPriorInput(selector, expectedText): (app: Application) => Promise<Application>
| Name | Type |
|---|---|
selector |
string |
expectedText |
string |
fn
▸ (app): Promise<Application>
| Name | Type |
|---|---|
app |
Application |
Promise<Application>
packages/test/src/api/cli.ts:199
▸ Const getTextContent(app, selector): Promise<string>
| Name | Type |
|---|---|
app |
Application |
selector |
string |
Promise<string>
packages/test/src/api/cli.ts:157
▸ Const grabFocus(app, currentPromptBlock?, currentPrompt?): Promise<boolean | void>
grab focus for the repl
| Name | Type |
|---|---|
app |
Application |
currentPromptBlock |
string |
currentPrompt |
string |
Promise<boolean | void>
packages/test/src/api/cli.ts:28
▸ lastBlock(app, splitIndex?, N?, inNotebook?): Promise<AppAndCount>
Index of last executed block
| Name | Type | Default value |
|---|---|---|
app |
Application |
undefined |
splitIndex |
number |
1 |
N |
number |
1 |
inNotebook |
boolean |
false |
Promise<AppAndCount>
packages/test/src/api/cli.ts:223
▸ Const makeCustom(selector, expect, exact?): Object
wait for the result of a cli.command
| Name | Type |
|---|---|
selector |
string |
expect |
string |
exact? |
boolean |
Object
| Name | Type |
|---|---|
exact |
boolean |
expect |
string |
selector |
string |
packages/test/src/api/cli.ts:169
▸ nOfCurrentBlock(app, splitIndex?): Promise<number>
| Name | Type | Default value |
|---|---|---|
app |
Application |
undefined |
splitIndex |
number |
1 |
Promise<number>
the "N" of the current block
packages/test/src/api/cli.ts:215
▸ Const paste(cmd, app, nLines?): Promise<{ app: Application = app; count: number }>
| Name | Type | Default value |
|---|---|---|
cmd |
string |
undefined |
app |
Application |
undefined |
nLines |
number |
1 |
Promise<{ app: Application = app; count: number }>
packages/test/src/api/cli.ts:115
▸ Const waitForRepl(app): Promise<Application>
wait for the repl to be active
| Name | Type |
|---|---|
app |
Application |
Promise<Application>
packages/test/src/api/cli.ts:128
▸ Const waitForSession(ctx, noProxySessionWait?): Promise<void>
Wait, if needed, for a proxy session
| Name | Type | Default value |
|---|---|---|
ctx |
ISuite |
undefined |
noProxySessionWait |
boolean |
false |
Promise<void>