import { resolve , join } from 'path' ; import { getConfigPath } from '@osd/utils' ; import { getConfigurationFilePaths } from './get_config_file_paths' ; describe ( 'getConfigurationFilePaths' , ( ) => { const cwd = process . cwd ( ) ; it ( 'retrieve the config file paths from the command line arguments' , ( ) => { const argv = [ '--config' , './relative-path' , '-c' , '/absolute-path' ] ; expect ( getConfigurationFilePaths ( argv ) ) . toEqual ( [ resolve ( cwd , join ( '.' , 'relative-path' ) ) , '/absolute-path' , ] ) ; } ) ; it ( 'fallbacks to `getConfigPath` value' , ( ) => { expect ( getConfigurationFilePaths ( [ ] ) ) . toEqual ( [ getConfigPath ( ) ] ) ; } ) ; } ) ;