本文整理汇总了TypeScript中assert.strict.throws方法的典型用法代码示例。如果您正苦于以下问题:TypeScript strict.throws方法的具体用法?TypeScript strict.throws怎么用?TypeScript strict.throws使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assert.strict
的用法示例。
在下文中一共展示了strict.throws方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('arguments', function() {
assert.throws(function() { bitgo.authenticateWithAuthCode(); });
assert.throws(function() { bitgo.authenticateWithAuthCode({ authCode: 123 }); });
assert.throws(function() { bitgo.authenticateWithAuthCode({ authCode: 'foo' }, 123); });
const bitgoNoClientId = new BitGoJS.BitGo();
assert.throws(function() { bitgoNoClientId.authenticateWithAuthCode({ authCode: TestBitGo.TEST_AUTHCODE }, function() {}); });
});
示例2: it
it('arguments', function() {
assert.throws(function() { pendingApprovals.list({}, 'invalid'); });
assert.throws(function() { pendingApprovals.list('invalid'); });
assert.throws(function() { pendingApprovals.list({ walletId: 54312 }); });
assert.throws(function() { pendingApprovals.list({ enterpriseId: 54312 }); });
assert.throws(function() { pendingApprovals.list({ walletId: TestBitGo.TEST_SHARED_WALLET_ADDRESS, enterpriseId: TestBitGo.TEST_ENTERPRISE }); });
});
示例3: it
it('arguments', function() {
assert.throws(function() { travel.sendMany({}); });
assert.throws(function() { travel.sendMany({ txid: txid }); });
assert.throws(function() { travel.sendMany({ txid: txid, travelInfos: 'foo' }); });
assert.throws(function() { travel.sendMany({ txid: txid, travelInfos: {} }, 'invalid'); });
assert.throws(function() { travel.sendMany({ txid: txid, travelInfos: [{}] }); });
});
示例4: it
it('isValid', function() {
assert.throws(function() { keychains.isValid(''); });
assert.throws(function() { keychains.isValid({}); });
assert.equal(keychains.isValid({ key: 'hello world' }), false);
assert.equal(keychains.isValid({ key: 'xpub123123' }), false);
assert.equal(keychains.isValid({ key: 'xprv123123' }), false);
assert.equal(keychains.isValid({ key: 'xpub661MyMwAqRbcH5xFjpBfCe74cj5tks4nxE8hSMepNfsMVsBkx8eT1m9mnR1tAMGdbbdsE8yMDcuZ3NgVJbTzCYDiu8rcc3sqLF6vzi9yfTB' }), true);
assert.equal(keychains.isValid({ key: 'xprv9s21ZrQH143K2hrPzWSx6ZXUbcq6Skc22ZsACrjzx6wae8fV63x9gbixpv89ssBvcYLju8BSbjSVF1q2DM1BnFdhi65fgbYrS5WE9UzZaaw' }), true);
});
示例5: it
it('arguments', function() {
assert.throws(function() { bitgo.addAccessToken({}, 'invalid'); });
assert.throws(function() { bitgo.addAccessToken({}, function() {}); });
assert.throws(function() {
bitgo.addAccessToken({
otp: bitgo.testUserOTP(),
scope: ['wallet_view_all', 'openid', 'profile']
}, 'invalid');
});
});