import { createMock } from 'ts-auto-mock' ; const computedProperty = 'C' as const ; describe ( 'computed properties constant' , ( ) => { interface Computed { [ computedProperty ] : string ; } it ( 'should assign the correct value' , ( ) => { const mock = createMock < Computed > ( ) ; expect ( mock . C ) . toBe ( '' ) ; } ) ; } ) ; describe ( 'computed property enum' , ( ) => { enum Enum { A , B = 'test' , C = '%test' } interface ComputedEnum { [ Enum . A ] : boolean ; [ Enum . B ] : number ; [ Enum . C ] : string ; } it ( 'should assign the correct value' , ( ) => { const mock = createMock < ComputedEnum > ( ) ; expect ( mock [ 0 ] ) . toBe ( false ) ; expect ( mock . test ) . toBe ( 0 ) ; expect ( mock [ '%test' ] ) . toBe ( '' ) ; } ) ; } ) ;