import { getEnvironments } from './get_environments' ; import { SearchParamsMock , inspectSearchParams , } from '../../utils/test_helpers' ; describe ( 'getEnvironments' , ( ) => { let mock ; afterEach ( ( ) => { mock . teardown ( ) ; } ) ; it ( 'fetches environments' , async ( ) => { mock = await inspectSearchParams ( ( setup ) => getEnvironments ( { setup , serviceName : 'foo' , searchAggregatedTransactions : false , size : 50 , start : 0 , end : 50000 , } ) ) ; expect ( mock . params ) . toMatchSnapshot ( ) ; } ) ; it ( 'fetches environments without a service name' , async ( ) => { mock = await inspectSearchParams ( ( setup ) => getEnvironments ( { setup , searchAggregatedTransactions : false , size : 50 , start : 0 , end : 50000 , } ) ) ; expect ( mock . params ) . toMatchSnapshot ( ) ; } ) ; } ) ;