本文整理匯總了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');
});
});