本文整理匯總了TypeScript中ref/js/chai.assert類的典型用法代碼示例。如果您正苦於以下問題:TypeScript assert類的具體用法?TypeScript assert怎麽用?TypeScript assert使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了assert類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
.then((data)=>{
chai.assert.equal(data.state, stateCode.SUCCESS);
chai.assert.equal(option.data.userName, data.user.userName);
}, (error)=>{
示例2: it
it("should get right counts of day of specified date", function() {
chai.assert.equal(Util.getCountDays('2016/8/8'), 31, 'August must have 31 days');
chai.assert.equal(Util.getCountDays('2016/9/10'), 30, ' September must have 30 days');
});
示例3: function
let handler = topic.subscribe('finance/financeDataChanged', function() {
let data: Array<any> = financePreviewStore.getStore();
chai.assert.lengthOf(data, 24, 'the length should be 24');
chai.assert.typeOf(data[0], 'number', 'the data type must be number');
done();
});