import { booleanRt } from './boolean_rt' ; import { isRight } from 'fp-ts/lib/Either' ; describe ( 'booleanRt' , ( ) => { describe ( 'it should not accept' , ( ) => { [ undefined , null , '' , 0 , 'foo' , true , false ] . map ( ( input ) => { it ( `${ JSON . stringify ( input ) }` , ( ) => { expect ( isRight ( booleanRt . decode ( input ) ) ) . toBe ( false ) ; } ) ; } ) ; } ) ; describe ( 'it should accept' , ( ) => { [ 'true' , 'false' ] . map ( ( input ) => { it ( `${ JSON . stringify ( input ) }` , ( ) => { expect ( isRight ( booleanRt . decode ( input ) ) ) . toBe ( true ) ; } ) ; } ) ; } ) ; } ) ;