本文整理汇总了TypeScript中@jupyterlab/notebook.NotebookActions.run方法的典型用法代码示例。如果您正苦于以下问题:TypeScript NotebookActions.run方法的具体用法?TypeScript NotebookActions.run怎么用?TypeScript NotebookActions.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@jupyterlab/notebook.NotebookActions
的用法示例。
在下文中一共展示了NotebookActions.run方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should handle no session', () => {
return NotebookActions.run(widget, null).then(result => {
expect(result).to.be(true);
let cell = widget.activeCell as CodeCell;
expect(cell.model.executionCount).to.be(null);
});
});
示例2: getCurrent
execute: args => {
let current = getCurrent(args);
if (!current) {
return;
}
return NotebookActions.run(current.notebook, current.context.session);
},
示例3: getCurrent
execute: args => {
const current = getCurrent(args);
if (current) {
const { context, notebook } = current;
return NotebookActions.run(notebook, context.session);
}
},
示例4: it
it('should render all markdown cells on an error', () => {
let cell = widget.model.contentFactory.createMarkdownCell({});
widget.model.cells.push(cell);
let child = widget.widgets[widget.widgets.length - 1] as MarkdownCell;
child.rendered = false;
widget.select(child);
widget.activeCell.model.value.text = ERROR_INPUT;
return NotebookActions.run(widget, session).then(result => {
expect(result).to.be(false);
expect(child.rendered).to.be(true);
});
});