license import { ENV } from '@tensorflow/tfjs-core' ; import { isLocalPath } from './source_util' ; const nonPathString = 'iamnotlocalpath' ; const testData = ENV . get ( 'IS_BROWSER' ) ? new Blob ( [ nonPathString ] ) : Buffer . from ( nonPathString ) ; describe ( 'source_util' , ( ) => { it ( 'returns true if it is local path' , ( ) => { const result = isLocalPath ( 'file://testfile' ) ; expect ( result ) . toBeTruthy ( ) ; } ) ; it ( 'returns false if it is not local path' , ( ) => { const result = isLocalPath ( nonPathString ) ; expect ( result ) . toBeFalsy ( ) ; } ) ; it ( 'returns false if it is not string type' , ( ) => { const result = isLocalPath ( testData ) ; expect ( result ) . toBeFalsy ( ) ; } ) ; } ) ;