本文整理匯總了TypeScript中@nteract/commutable.makeStreamOutput函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript makeStreamOutput函數的具體用法?TypeScript makeStreamOutput怎麽用?TypeScript makeStreamOutput使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了makeStreamOutput函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
test("merges streams of text", () => {
let outputs = Immutable.List();
outputs = reduceOutputs(outputs, {
name: "stdout",
text: "hello",
output_type: "stream"
});
expect(
Immutable.is(
outputs,
Immutable.fromJS([makeStreamOutput({ name: "stdout", text: "hello" })])
)
).toBe(true);
outputs = reduceOutputs(outputs, {
name: "stdout",
text: " world",
output_type: "stream"
});
expect(
Immutable.is(
outputs,
Immutable.fromJS([
makeStreamOutput({ name: "stdout", text: "hello world" })
])
)
).toBe(true);
});
示例2: test
test("handles the case of a single stream output", () => {
const outputs = Immutable.List([
makeStreamOutput({ name: "stdout", text: "hello" })
]);
const newOutputs = reduceOutputs(outputs, {
name: "stdout",
text: " world",
output_type: "stream"
});
expect(newOutputs).toEqual(
Immutable.List([
makeStreamOutput({
name: "stdout",
text: "hello world",
output_type: "stream"
})
])
);
});