本文整理匯總了TypeScript中assert.strict.equal方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript strict.equal方法的具體用法?TypeScript strict.equal怎麽用?TypeScript strict.equal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類assert.strict
的用法示例。
在下文中一共展示了strict.equal方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should work fine for IPv4', () => {
assert.equal(ip.validate('64.4.4.4'), true);
assert.equal(ip.validate('64.4.4.boom!'), false);
// @ts-ignore
assert.equal(ip.validate(undefined), false);
assert.equal(ip.validate('kraken'), false);
});
示例2: function
bitgo.keychains().add(options, function(err, keychain) {
assert.equal(err, null);
assert.equal(keychain.xpub, keychains[1].xpub);
bitgo.keychains().createBitGo({}, function(err, keychain) {
assert(keychain.xpub);
keychains.push(keychain);
const options = {
label: 'my wallet',
m: 2,
n: 3,
keychains: keychains.map(function(k) { return { xpub: k.xpub }; })
};
wallets.add(options, function(err, wallet) {
assert.equal(err, null);
testWallet = wallet;
assert.equal(wallet.balance(), 0);
assert.equal(wallet.label(), 'my wallet');
assert.equal(wallet.confirmedBalance(), 0);
assert.equal(wallet.keychains.length, 3);
assert.equal(bitgo.keychains().isValid({ key: wallet.keychains[0].xpub }), true);
assert.equal(bitgo.keychains().isValid({ key: wallet.keychains[1].xpub }), true);
assert.equal(bitgo.keychains().isValid({ key: wallet.keychains[2].xpub }), true);
assert.equal(wallet.keychains[0].xpub, keychains[0].xpub);
assert.equal(wallet.keychains[1].xpub, keychains[1].xpub);
done();
});
});
});
示例3: function
keychains.update(options, function(err, keychain) {
assert.equal(err, null);
assert.equal(keychain.xpub, newKey.xpub);
assert.equal(keychain.encryptedXprv, 'abracadabra');
assert.equal(keychain.path, 'm');
done();
});
示例4: function
blockchain.getAddressTransactions(options, function(err, result) {
assert.equal(err, null);
assert.equal(Array.isArray(result.transactions), true);
assert.equal(result.start, 0);
result.should.have.property('total');
result.should.have.property('count');
done();
});
示例5: 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);
});