import { createMock , createMockList , registerMock } from 'ts-auto-mock' ; describe ( 'registerMock type literal' , ( ) => { it ( 'should never work' , ( ) => { registerMock < { prop : string ; } > ( ( ) => ( { prop : 'mocked one' } ) ) ; const mock1 = createMock < { prop : string ; } > ( ) ; const mock2 = createMockList < { prop : string ; } > ( 1 ) ; const mock3 = createMock < { sub : { prop : string ; } ; } > ( ) ; interface Interface { sub : { prop : string ; } ; } const mock4 = createMock < Interface > ( ) ; type Literal = { prop : string ; } ; const mock5 = createMock < Literal > ( ) ; type Intersection = { prop : string ; } & { some : number ; } ; const mock6 = createMock < Intersection > ( ) ; expect ( mock1 . prop ) . toBe ( '' ) ; expect ( mock2 [ 0 ] . prop ) . toBe ( '' ) ; expect ( mock3 . sub . prop ) . toBe ( '' ) ; expect ( mock4 . sub . prop ) . toBe ( '' ) ; expect ( mock5 . prop ) . toBe ( '' ) ; expect ( mock6 . prop ) . toBe ( '' ) ; } ) ; } ) ;