import 'jest' ; import { assert , notNullOrUndefined , nullable , numeric , oneOf } from '../../../utils/utils.v2' ; import { isA , typeCheckFor } from 'ts-type-checked' ; import fc from 'fast-check' ; describe ( 'classes' , ( ) => { test ( 'ES6 private properties' , ( ) => { class TypeReference1 { #property = '' ; #anotherProperty : number ; constructor ( anotherProperty = 1 ) { this . #anotherProperty = anotherProperty ; } #privateMethodWithInitializer = ( ) => { } ; } const validArbitrary = oneOf ( fc . constantFrom ( new TypeReference1 ( 6 ) , new TypeReference1 ( ) ) , numeric ( ) . map ( ( a ) => new TypeReference1 ( a ) ) , fc . anything ( ) . filter ( notNullOrUndefined ) as fc . Arbitrary < TypeReference1 > ) ; const invalidArbitrary = nullable ( ) ; assert ( validArbitrary , invalidArbitrary , [ typeCheckFor < TypeReference1 > ( ) , ( value ) => isA < TypeReference1 > ( value ) ] ) ; } ) ; } ) ;