本文整理汇总了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();
});
示例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();
});
});
示例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,
});
}
示例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`);
}
示例5: assert
.then(function() {
assert(false); // should not get here
})
示例6: function
bitgo.logout({}, function(err) {
// logout should fail when not logged in
assert(err);
done();
});