import {
  runCreatePackageCli,
  removeTmpProject,
} from '@nx/plugin/testing';

describe('<%= name %> e2e', () => {
  const project = '<%= name %>';
  let createPackageResult;

  beforeAll(async () => {
    // Create project using CLI command
    createPackageResult = await runCreatePackageCli(
      project,
      {
        pluginLibraryBuildPath: '<%= pluginOutputPath %>',
        createPackageLibraryBuildPath: '<%= cliOutputPath %>',
      }
    );
  }, 240_000);

  afterAll(() => {
    // Remove the generated project from the file system
    removeTmpProject(project);
  });

  it('should create project using <%= name %>', () => {
    expect(createPackageResult).toContain('Successfully created');
  });
});
