本文整理匯總了TypeScript中@jupyterlab/services/src/kernel.Kernel.startNew方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Kernel.startNew方法的具體用法?TypeScript Kernel.startNew怎麽用?TypeScript Kernel.startNew使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@jupyterlab/services/src/kernel.Kernel
的用法示例。
在下文中一共展示了Kernel.startNew方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should test whether the kernel is ready', async () => {
const kernel = await Kernel.startNew();
expect(kernel.isReady).to.equal(false);
await kernel.ready;
expect(kernel.isReady).to.equal(true);
await kernel.shutdown();
});
示例2: it
it('should accept server settings', async () => {
const serverSettings = makeSettings();
const kernel = await Kernel.startNew({ serverSettings });
const response = await Kernel.listRunning(serverSettings);
expect(toArray(response).length).to.be.greaterThan(0);
await kernel.shutdown();
});
示例3: it
it('should emit a runningChanged signal', async () => {
let called = false;
manager.runningChanged.connect(() => {
called = true;
});
const k = await Kernel.startNew();
await manager.connectTo(k.model);
expect(called).to.equal(true);
});
示例4: it
it('should accept the id of the new kernel', async () => {
session = await startNew();
const previous = session.kernel;
await previous.ready;
const kernel = await Kernel.startNew();
await kernel.ready;
await session.changeKernel({ id: kernel.id });
await session.kernel.ready;
expect(session.kernel.id).to.equal(kernel.id);
expect(session.kernel).to.not.equal(previous);
expect(session.kernel).to.not.equal(kernel);
previous.dispose();
kernel.dispose();
});
示例5: beforeAll
beforeAll(async () => {
kernel = await Kernel.startNew();
});