Namespace: CLI

January 18, 2022 · View on GitHub

Kui API Documentation - v11.0.0 / @kui-shell/test / CLI

Namespace: CLI

@kui-shell/test.CLI

Table of contents

Variables

Functions

Variables

timeout

timeout: number

Defined in

packages/test/src/api/cli.ts:24


waitTimeout

waitTimeout: number

Defined in

packages/test/src/api/cli.ts:25

Functions

command

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

Parameters

NameTypeDefault value
cmdstringundefined
appApplicationundefined
noNewlinebooleanfalse
noCopyPastebooleanundefined
noFocusbooleanfalse
blockstringundefined
currentPromptstringundefined

Returns

Promise<{ app: Application = app; count: number }>

Defined in

packages/test/src/api/cli.ts:56


commandInSplit

Const commandInSplit(cmd, app, splitIndex): Promise<{ app: Application = app; count: number } & { splitIndex: number }>

Execute the given command in the given split

Parameters

NameType
cmdstring
appApplication
splitIndexnumber

Returns

Promise<{ app: Application = app; count: number } & { splitIndex: number }>

Defined in

packages/test/src/api/cli.ts:102


exitCode

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.

Parameters

NameType
statusCodestring | number

Returns

string | number

Defined in

packages/test/src/api/cli.ts:179


expandLast

expandLast(app, splitIndex?, N?): Promise<void>

Click to expand the last replayed sample output

Parameters

NameTypeDefault value
appApplicationundefined
splitIndexnumber1
Nnumber1

Returns

Promise<void>

Defined in

packages/test/src/api/cli.ts:244


expandNth

expandNth(app, N, splitIndex?): Promise<void>

Click to expand the last replayed sample output

Parameters

NameTypeDefault value
appApplicationundefined
Nnumberundefined
splitIndexnumber1

Returns

Promise<void>

Defined in

packages/test/src/api/cli.ts:237


expectInput

Const expectInput(selector, expectedText): (app: Application) => Promise<Application>

Parameters

NameType
selectorstring
expectedTextstring

Returns

fn

▸ (app): Promise<Application>

Parameters
NameType
appApplication
Returns

Promise<Application>

Defined in

packages/test/src/api/cli.ts:181


expectInputContext

expectInputContext(res, N, expectedText, exact?): Promise<boolean>

text repl input context text

Parameters

NameTypeDefault value
resAppAndCountundefined
Nnumberundefined
expectedTextstringundefined
exactbooleanfalse

Returns

Promise<boolean>

Defined in

packages/test/src/api/cli.ts:193


expectPriorInput

Const expectPriorInput(selector, expectedText): (app: Application) => Promise<Application>

Parameters

NameType
selectorstring
expectedTextstring

Returns

fn

▸ (app): Promise<Application>

Parameters
NameType
appApplication
Returns

Promise<Application>

Defined in

packages/test/src/api/cli.ts:199


getTextContent

Const getTextContent(app, selector): Promise<string>

Parameters

NameType
appApplication
selectorstring

Returns

Promise<string>

Defined in

packages/test/src/api/cli.ts:157


grabFocus

Const grabFocus(app, currentPromptBlock?, currentPrompt?): Promise<boolean | void>

grab focus for the repl

Parameters

NameType
appApplication
currentPromptBlockstring
currentPromptstring

Returns

Promise<boolean | void>

Defined in

packages/test/src/api/cli.ts:28


lastBlock

lastBlock(app, splitIndex?, N?, inNotebook?): Promise<AppAndCount>

Index of last executed block

Parameters

NameTypeDefault value
appApplicationundefined
splitIndexnumber1
Nnumber1
inNotebookbooleanfalse

Returns

Promise<AppAndCount>

Defined in

packages/test/src/api/cli.ts:223


makeCustom

Const makeCustom(selector, expect, exact?): Object

wait for the result of a cli.command

Parameters

NameType
selectorstring
expectstring
exact?boolean

Returns

Object

NameType
exactboolean
expectstring
selectorstring

Defined in

packages/test/src/api/cli.ts:169


nOfCurrentBlock

nOfCurrentBlock(app, splitIndex?): Promise<number>

Parameters

NameTypeDefault value
appApplicationundefined
splitIndexnumber1

Returns

Promise<number>

the "N" of the current block

Defined in

packages/test/src/api/cli.ts:215


paste

Const paste(cmd, app, nLines?): Promise<{ app: Application = app; count: number }>

Parameters

NameTypeDefault value
cmdstringundefined
appApplicationundefined
nLinesnumber1

Returns

Promise<{ app: Application = app; count: number }>

Defined in

packages/test/src/api/cli.ts:115


waitForRepl

Const waitForRepl(app): Promise<Application>

wait for the repl to be active

Parameters

NameType
appApplication

Returns

Promise<Application>

Defined in

packages/test/src/api/cli.ts:128


waitForSession

Const waitForSession(ctx, noProxySessionWait?): Promise<void>

Wait, if needed, for a proxy session

Parameters

NameTypeDefault value
ctxISuiteundefined
noProxySessionWaitbooleanfalse

Returns

Promise<void>

Defined in

packages/test/src/api/cli.ts:141