license import { assert } from 'chai' ; import * as path from 'path' ; import * as fsUtil from '../../util/fs' ; const knownDirectoryPath = __dirname ; const knownFilePath = __filename ; const knownDoesNotExistPath = path . join ( __dirname , 'AI92J53002GKGNFIAWNF' ) ; suite ( 'src/util/fs' , ( ) => { suite ( 'existsSync()' , ( ) => { test ( 'returns true if something exists at path' , async ( ) => { assert . isTrue ( fsUtil . existsSync ( knownDirectoryPath ) ) ; assert . isTrue ( fsUtil . existsSync ( knownFilePath ) ) ; } ) ; test ( 'returns false if directory does not exist' , async ( ) => { assert . isFalse ( fsUtil . existsSync ( knownDoesNotExistPath ) ) ; } ) ; } ) ; suite ( 'isDirSync()' , ( ) => { test ( 'returns true if path is a directory' , async ( ) => { assert . isTrue ( fsUtil . isDirSync ( knownDirectoryPath ) ) ; } ) ; test ( 'returns false if path is a file' , async ( ) => { assert . isFalse ( fsUtil . isDirSync ( knownFilePath ) ) ; } ) ; test ( 'returns false if nothing exists at path' , async ( ) => { assert . isFalse ( fsUtil . isDirSync ( knownDoesNotExistPath ) ) ; } ) ; } ) ; } ) ;