import { parseBoolean } from './parse-boolean' ; describe ( 'parseBoolean transform' , ( ) => { it ( 'should return true with input "true"' , ( ) => { const input = 'true' ; const result = parseBoolean ( input ) ; expect ( result ) . toBe ( true ) ; } ) ; it ( 'should return true with input "on"' , ( ) => { const input = 'on' ; const result = parseBoolean ( input ) ; expect ( result ) . toBe ( true ) ; } ) ; it ( 'should return true with input "1"' , ( ) => { const input = '1' ; const result = parseBoolean ( input ) ; expect ( result ) . toBe ( true ) ; } ) ; it ( 'should return false with input "false"' , ( ) => { const input = 'false' ; const result = parseBoolean ( input ) ; expect ( result ) . toBe ( false ) ; } ) ; it ( 'should return false with input "off"' , ( ) => { const input = 'off' ; const result = parseBoolean ( input ) ; expect ( result ) . toBe ( false ) ; } ) ; it ( 'should return false with input "0"' , ( ) => { const input = '0' ; const result = parseBoolean ( input ) ; expect ( result ) . toBe ( false ) ; } ) ; it ( 'should return undefined with input undefined' , ( ) => { const input = undefined ; const result = parseBoolean ( input ) ; expect ( result ) . toBeUndefined ; } ) ; it ( 'should return undefined with other strings 1/2' , ( ) => { const input = 'undefined' ; const result = parseBoolean ( input ) ; expect ( result ) . toBeUndefined ; } ) ; it ( 'should return undefined with other strings 2/2' , ( ) => { const input = 'random' ; const result = parseBoolean ( input ) ; expect ( result ) . toBeUndefined ; } ) ; it ( 'should return undefined with empty string' , ( ) => { const input = '' ; const result = parseBoolean ( input ) ; expect ( result ) . toBeUndefined ; } ) ; it ( 'should return undefined with truthy expression' , ( ) => { const input = '2' ; const result = parseBoolean ( input ) ; expect ( result ) . toBeUndefined ; } ) ; it ( 'should return true with actual true value' , ( ) => { const input = true ; const result = parseBoolean ( input ) ; expect ( result ) . toBe ( true ) ; } ) ; it ( 'should return false with actual false value' , ( ) => { const input = false ; const result = parseBoolean ( input ) ; expect ( result ) . toBe ( false ) ; } ) ; it ( 'should return true with 1 (as number) value' , ( ) => { const input = 1 ; const result = parseBoolean ( input ) ; expect ( result ) . toBe ( true ) ; } ) ; it ( 'should return false with 0 (as number) value' , ( ) => { const input = 0 ; const result = parseBoolean ( input ) ; expect ( result ) . toBe ( false ) ; } ) ; } ) ;