本文整理汇总了TypeScript中@jupyterlab/filebrowser.FileBrowserModel.uploads方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FileBrowserModel.uploads方法的具体用法?TypeScript FileBrowserModel.uploads怎么用?TypeScript FileBrowserModel.uploads使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@jupyterlab/filebrowser.FileBrowserModel
的用法示例。
在下文中一共展示了FileBrowserModel.uploads方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it(`should produce progress as a large file uploads`, async () => {
const fname = UUID.uuid4() + '.txt';
const file = new File([new ArrayBuffer(2 * CHUNK_SIZE)], fname);
const {
cleanup,
values: [start, first, second, finished]
} = signalToPromises(model.uploadChanged, 4);
model.upload(file);
expect(iteratorToList(model.uploads())).to.eql([]);
expect(await start).to.eql([
model,
{
name: 'start',
oldValue: null,
newValue: { path: fname, progress: 0 }
}
]);
expect(iteratorToList(model.uploads())).to.eql([
{ path: fname, progress: 0 }
]);
expect(await first).to.eql([
model,
{
name: 'update',
oldValue: { path: fname, progress: 0 },
newValue: { path: fname, progress: 0 }
}
]);
expect(iteratorToList(model.uploads())).to.eql([
{ path: fname, progress: 0 }
]);
expect(await second).to.eql([
model,
{
name: 'update',
oldValue: { path: fname, progress: 0 },
newValue: { path: fname, progress: 1 / 2 }
}
]);
expect(iteratorToList(model.uploads())).to.eql([
{ path: fname, progress: 1 / 2 }
]);
expect(await finished).to.eql([
model,
{
name: 'finish',
oldValue: { path: fname, progress: 1 / 2 },
newValue: null
}
]);
expect(iteratorToList(model.uploads())).to.eql([]);
cleanup();
});