本文整理匯總了TypeScript中@bokehjs/client/connection.pull_session函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript pull_session函數的具體用法?TypeScript pull_session怎麽用?TypeScript pull_session使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了pull_session函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: pull_session
(session1) => {
return pull_session(server_process.url, session1.id).then(
(session2) => {
try {
expect(session2.document.roots().length).to.equal(1)
const root = session2.document.roots()[0]
expect(root).instanceof(Range1d)
const obj = root as Range1d
expect(obj.start).to.equal(123)
expect(obj.end).to.equal(456)
expect(session2.document.title()).to.equal("Hello Title")
} catch (e) {
throw e
} finally {
session1.close()
session2.close()
}
return "OK"
},
(error) => {
session1.close()
throw error
},
).catch((error) => {
// es6 promises would swallow the test errors otherwise
throw error
})
},
示例2: with_server
const promise = with_server((server_process) => {
return pull_session(server_process.url, undefined, "foo=10&bar=20").then(
(session) => {
expect((session as any)._connection.args_string).to.be.equal("foo=10&bar=20") // XXX
return "OK"
},
)
})