MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / waitForTextOutput

Function waitForTextOutput

src/test/datascience/notebook/helper.ts:1191–1213  ·  view source on GitHub ↗
(
    cell: NotebookCell,
    text: string,
    index: number = 0,
    isExactMatch = true,
    timeout = defaultNotebookTestTimeout
)

Source from the content-addressed store, hash-verified

1189 return result;
1190}
1191export async function waitForTextOutput(
1192 cell: NotebookCell,
1193 text: string,
1194 index: number = 0,
1195 isExactMatch = true,
1196 timeout = defaultNotebookTestTimeout
1197) {
1198 await waitForCondition(
1199 async () => assertHasTextOutputInVSCode(cell, text, index, isExactMatch),
1200 timeout,
1201 () =>
1202 `After ${timeout}ms output, does not contain provided text '${text}' for Cell ${
1203 cell.index + 1
1204 } in output index ${index}, the outputs are: \n${cell.outputs
1205 .map(
1206 (output, index) =>
1207 `${index}. Output for Index "${index}" with total outputs ${
1208 output.items.length
1209 } is "${output.items.map(getOutputText).join('\n')}"`
1210 )
1211 .join(',\n')}`
1212 );
1213}
1214export function assertNotHasTextOutputInVSCode(cell: NotebookCell, text: string, index: number, isExactMatch = true) {
1215 const cellOutputs = cell.outputs;
1216 assert.ok(cellOutputs, 'No output');

Calls 4

waitForConditionFunction · 0.90
joinMethod · 0.80
mapMethod · 0.80