text: import { filterPackageName, runServiceHook, getRunnerName } from '../src/utils'
  
  test('filterPackageName', () => {
      const reporter = [
          ' dot - https://www.npmjs.com/package/@wdio/dot-reporter',
          ' spec - https://www.npmjs.com/package/@wdio/spec-reporter',
          ' junit - https://www.npmjs.com/package/@wdio/junit-reporter',
          ' random - https://www.npmjs.com/package/wdio-random-reporter'
      ]
      expect(filterPackageName('reporter')(reporter)).toEqual([
          '@wdio/dot-reporter',
          '@wdio/spec-reporter',
          '@wdio/junit-reporter',
          'wdio-random-reporter'
      ])
  })
  
  test('runServiceHook', () => {
      const hookSuccess = jest.fn()
      const hookFailing = jest.fn().mockImplementation(() => { throw new Error('buhh') })
      runServiceHook([
          { onPrepare: hookSuccess },
          { onPrepare: 'foobar' },
          { onPrepare: hookFailing },
          { onComplete: hookSuccess }
      ], 'onPrepare', 1, true, 'abc')
      expect(hookSuccess).toBeCalledTimes(1)
      expect(hookFailing).toBeCalledTimes(1)
  })
  
  test('getRunnerName', () => {
      expect(getRunnerName({ browserName: 'foobar' })).toBe('foobar')
      expect(getRunnerName({ appPackage: 'foobar' })).toBe('foobar')
      expect(getRunnerName({ appWaitActivity: 'foobar' })).toBe('foobar')
      expect(getRunnerName({ app: 'foobar' })).toBe('foobar')
      expect(getRunnerName({ platformName: 'foobar' })).toBe('foobar')
      expect(getRunnerName({})).toBe('undefined')
  })
  