本文整理汇总了TypeScript中assert.strict函数的典型用法代码示例。如果您正苦于以下问题:TypeScript strict函数的具体用法?TypeScript strict怎么用?TypeScript strict使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了strict函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: 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');
assert(result.transactions.length > 20);
assert.equal(result.transactions.length, result.count);
assert(result.total > 75);
done();
});
开发者ID:BitGo,项目名称:BitGoJS,代码行数:11,代码来源:blockchain.ts
示例2: function
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();
});
});
开发者ID:BitGo,项目名称:BitGoJS,代码行数:26,代码来源:wallets.ts
示例3: constructor
constructor(semester: Semester, academicYear: string = config.academicYear) {
assert(validateSemester(semester), `${semester} is not a valid semester`);
super(academicYear);
this.semester = semester;
this.academicYear = academicYear;
this.outputCache = this.getCache<Output>(`semester-${semester}-module-data`);
this.logger = this.rootLogger.child({
semester,
year: academicYear,
task: GetSemesterData.name,
});
}
开发者ID:nusmodifications,项目名称:nusmods,代码行数:14,代码来源:GetSemesterData.ts
示例4: constructor
constructor(semester: Semester, academicYear: string = config.academicYear) {
assert(validateSemester(semester), `${semester} is not a valid semester`);
super(academicYear);
this.semester = semester;
this.academicYear = academicYear;
this.logger = this.rootLogger.child({
semester,
task: GetSemesterExams.name,
year: academicYear,
});
this.examCache = this.getCache<ModuleExam[]>(`semester-${semester}-exams`);
}
开发者ID:nusmodifications,项目名称:nusmods,代码行数:16,代码来源:GetSemesterExams.ts
示例5: assert
.then(function() {
assert(false); // should not get here
})
开发者ID:BitGo,项目名称:BitGoJS,代码行数:3,代码来源:travelRule.ts
示例6: function
bitgo.logout({}, function(err) {
// logout should fail when not logged in
assert(err);
done();
});
开发者ID:BitGo,项目名称:BitGoJS,代码行数:5,代码来源:bitgo.ts
注:本文中的assert.strict函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论