本文整理匯總了TypeScript中response/form/models/statement-of-means/monthlyExpenseType.MonthlyExpenseType.all方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript MonthlyExpenseType.all方法的具體用法?TypeScript MonthlyExpenseType.all怎麽用?TypeScript MonthlyExpenseType.all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類response/form/models/statement-of-means/monthlyExpenseType.MonthlyExpenseType
的用法示例。
在下文中一共展示了MonthlyExpenseType.all方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: describe
describe('valueOf', () => {
it('should return undefined when undefined given', () => {
const actual: MonthlyExpenseType = MonthlyExpenseType.valueOf(undefined)
expect(actual).to.be.eq(undefined)
})
it('should return undefined when unknown type given', () => {
const actual: MonthlyExpenseType = MonthlyExpenseType.valueOf('I do not know this type!')
expect(actual).to.be.eq(undefined)
})
MonthlyExpenseType.all().forEach(type => {
it(`should return valid object for ${type.value}`, () => {
const actual: MonthlyExpenseType = MonthlyExpenseType.valueOf(type.value)
expect(actual).to.be.equal(type)
})
})
})
示例2: describe
describe('Monthly expense type view filter', () => {
MonthlyExpenseType.all()
.forEach(type => {
it(`should map '${type.value}' to '${type.displayValue}'`, () => {
expect(ExpenseTypeViewFilter.render(type.value)).to.equal(type.displayValue)
})
})
it('should throw an error for anything else', () => {
expect(() => ExpenseTypeViewFilter.render('PET_TOYS')).to.throw(TypeError)
})
it('should throw an error for null', () => {
expect(() => ExpenseTypeViewFilter.render(null)).to.throw(TypeError)
})
})
示例3: it
it('should return an array', () => {
const actual: MonthlyExpenseType[] = MonthlyExpenseType.all()
expect(actual).instanceof(Array)
expect(actual.length).to.eq(14)
})