本文整理汇总了TypeScript中@phosphor/coreutils.UUID.uuid4方法的典型用法代码示例。如果您正苦于以下问题:TypeScript UUID.uuid4方法的具体用法?TypeScript UUID.uuid4怎么用?TypeScript UUID.uuid4使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@phosphor/coreutils.UUID
的用法示例。
在下文中一共展示了UUID.uuid4方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: createDomID
export function createDomID(): string {
return `id-${UUID.uuid4()}`;
}
示例2: it
it('should fail if the session is disposed', async () => {
const session = Session.connectTo(defaultSession.model);
session.dispose();
let promise = session.setPath(UUID.uuid4());
await expectFailure(promise, null, 'Session is disposed');
});
示例3: it
it('should start a session', async () => {
const session = await manager.startNew({ path: UUID.uuid4() });
await session.kernel.ready;
expect(session.id).to.be.ok;
return session.shutdown();
});
示例4: startNew
/**
* Start a new session with a unique name.
*/
function startNew(): Promise<Session.ISession> {
return Session.startNew({ path: UUID.uuid4() });
}
示例5: it
it('should fail for improper model', async () => {
handleRequest(defaultSession, 200, {});
await expectFailure(defaultSession.setName(UUID.uuid4()));
});
示例6: it
it('should accept ajax options', async () => {
const serverSettings = makeSettings();
const options: Session.IOptions = { path: UUID.uuid4(), serverSettings };
session = await Session.startNew(options);
expect(session.id).to.be.ok;
});