本文整理匯總了TypeScript中@jupyterlab/apputils.ClientSession類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ClientSession類的具體用法?TypeScript ClientSession怎麽用?TypeScript ClientSession使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ClientSession類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should return a matching language', () => {
const spec = manager.specs.kernelspecs[manager.specs.default];
const kernelspecs: any = {};
kernelspecs[spec.name] = spec;
expect(
ClientSession.getDefaultKernel({
specs: {
default: spec.name,
kernelspecs
},
preference: { language: spec.language }
})
).to.equal(spec.name);
});
示例2: it
it('should return null if no match is found', () => {
expect(ClientSession.getDefaultKernel({
specs: manager.specs,
preference: { name: 'foo' }
})).to.be(null);
});
示例3: it
it('should restart if the user accepts the dialog', () => {
let called = false;
return session.initialize().then(() => {
acceptDialog();
session.statusChanged.connect((sender, args) => {
if (args === 'restarting') {
called = true;
}
});
return session.restart();
}).then(() => {
expect(called).to.be(true);
});
});