本文整理汇总了TypeScript中helpers/entities.dataCredentialCreateWithOffer函数的典型用法代码示例。如果您正苦于以下问题:TypeScript dataCredentialCreateWithOffer函数的具体用法?TypeScript dataCredentialCreateWithOffer怎么用?TypeScript dataCredentialCreateWithOffer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dataCredentialCreateWithOffer函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('success: issued', async () => {
const data = await dataCredentialCreateWithOffer()
const credential = await credentialCreateWithOffer(data)
await credential.sendRequest({ connection: data.connection, payment: 0 })
assert.equal(await credential.getState(), StateType.OfferSent)
VCXMock.setVcxMock(VCXMockMessage.CredentialResponse)
VCXMock.setVcxMock(VCXMockMessage.UpdateIssuerCredential)
await credential.updateState()
assert.equal(await credential.getState(), StateType.Accepted)
})
示例2: async
it.skip('throws: missing connection', async () => {
const { connection, ...data } = await dataCredentialCreateWithOffer()
const error = await shouldThrow(() => Credential.create({ connection: {} as any, ...data }))
assert.equal(error.vcxCode, VCXCode.INVALID_OPTION)
})