本文整理匯總了TypeScript中response/form/models/statement-of-means/residenceType.ResidenceType類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ResidenceType類的具體用法?TypeScript ResidenceType怎麽用?TypeScript ResidenceType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ResidenceType類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should return all items except for the provided one', () => {
const filtered: ResidenceType[] = ResidenceType.except(ResidenceType.OTHER)
expect(filtered).to.contain(ResidenceType.OWN_HOME)
expect(filtered).to.contain(ResidenceType.JOINT_OWN_HOME)
expect(filtered).to.contain(ResidenceType.PRIVATE_RENTAL)
expect(filtered).to.contain(ResidenceType.COUNCIL_OR_HOUSING_ASSN_HOME)
expect(filtered).not.to.contain(ResidenceType.OTHER)
})
示例2: describe
describe('Residence type view filter', () => {
ResidenceType.all()
.forEach(type => {
it(`should map '${type.value}' to '${type.displayValue}'`, () => {
expect(ResidenceTypeViewFilter.render(type.value)).to.equal(type.displayValue)
})
})
it('should throw an error for anything else', () => {
expect(() => ResidenceTypeViewFilter.render('IGLOO')).to.throw(TypeError)
})
it('should throw an error for null', () => {
expect(() => ResidenceTypeViewFilter.render(null)).to.throw(TypeError)
})
})
示例3: expect
expect(() => ResidenceType.except(undefined)).to.throw(Error)
示例4: render
export function render (value: string): string {
return ResidenceType.valueOf(value).displayValue
}