jest.mock('../../gulpfile.ts/internal')
jest.mock('path')

import * as internal from '../../gulpfile.ts/internal'

describe('PACKAGES_INSTALLED', () => {
  it('should return an array of packages', () => {
    const spySureLazyImport = jest.spyOn(internal, 'sureLazyImport')
    spySureLazyImport.mockReturnValue({
      dependencies: {
        hello: '^1.1.1',
      },
      devDependencies: {
        hello: '^1.1.1',
        tralo: '^1.1.1',
      },
    })
    const { PACKAGES_INSTALLED } = require('../../gulpfile.ts/lib/PACKAGES_INSTALLED')
    expect(PACKAGES_INSTALLED).toMatchObject(['hello', 'tralo'])
  })
})
