import { isPackageInstalled } from '../../gulpfile.ts/lib/isPackageInstalled'
jest.mock('../../gulpfile.ts/internal')

describe('isPackageInstalled', () => {
  it('should return true if the supplied name exists', () => {
    const result = isPackageInstalled('hello')
    expect(result).toBeTruthy()
  })
  it('should throw an error if the supplied name does not exist', () => {
    try {
      isPackageInstalled('wat')
    } catch (e) {
      expect(e).toBeTruthy()
    }
  })
})
