import { REPO_ROOT } from '@osd/dev-utils' ; import { getEnvOptions } from '../config/mocks' ; import { PluginsConfig , PluginsConfigType } from './plugins_config' ; import { Env } from '../config' ; describe ( 'PluginsConfig' , ( ) => { it ( 'retrieves additionalPluginPaths from config.paths when in production mode' , ( ) => { const env = Env . createDefault ( REPO_ROOT , getEnvOptions ( { cliArgs : { dev : false } } ) ) ; const rawConfig = { initialize : true , paths : [ 'some-path' , 'another-path' ] , } ; const config = new PluginsConfig ( rawConfig , env ) ; expect ( config . additionalPluginPaths ) . toEqual ( [ 'some-path' , 'another-path' ] ) ; } ) ; it ( 'retrieves additionalPluginPaths from config.paths when in development mode' , ( ) => { const env = Env . createDefault ( REPO_ROOT , getEnvOptions ( { cliArgs : { dev : true } } ) ) ; const rawConfig = { initialize : true , paths : [ 'some-path' , 'another-path' ] , } ; const config = new PluginsConfig ( rawConfig , env ) ; expect ( config . additionalPluginPaths ) . toEqual ( [ 'some-path' , 'another-path' ] ) ; } ) ; } ) ;