From b6702b2855b38dc830aef8412e63895b4cff0859 Mon Sep 17 00:00:00 2001 From: Pedro Ramos Date: Fri, 19 Apr 2024 23:43:04 +0200 Subject: [PATCH] feat: remove `asyncapi new project`alias (#1375) --- src/commands/new/project.ts | 9 ---- test/integration/new/project.test.ts | 61 ---------------------------- 2 files changed, 70 deletions(-) delete mode 100644 src/commands/new/project.ts delete mode 100644 test/integration/new/project.test.ts diff --git a/src/commands/new/project.ts b/src/commands/new/project.ts deleted file mode 100644 index 5b0013431f0..00000000000 --- a/src/commands/new/project.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Config } from '@oclif/core'; -import NewGlee from './glee'; - -export default class NewProject extends NewGlee { - constructor(argv: string[], config: Config) { - super(argv, config); - this.commandName = 'project'; - } -} diff --git a/test/integration/new/project.test.ts b/test/integration/new/project.test.ts deleted file mode 100644 index 072abaaa878..00000000000 --- a/test/integration/new/project.test.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { test } from '@oclif/test'; -import TestHelper from '../../helpers'; -import { PROJECT_DIRECTORY_PATH } from '../../helpers'; -import { expect } from '@oclif/test'; - -const testHelper = new TestHelper(); - -describe('new project', () => { - before(() => { - try { - testHelper.deleteDummyProjectDirectory(); - } catch (e: any) { - if (e.code !== 'ENOENT') { - throw e; - } - } - }); - - describe('creation of new project is successful', () => { - afterEach(() => { - testHelper.deleteDummyProjectDirectory(); - }); - - test - .stderr() - .stdout() - .command(['new:project', '-n=test-project']) - .it('runs new project command with name flag', async (ctx,done) => { - expect(ctx.stderr).to.equal(''); - expect(ctx.stdout).to.equal('Your project "test-project" has been created successfully!\n\nNext steps:\n\n cd test-project\n npm install\n npm run dev\n\nAlso, you can already open the project in your favorite editor and start tweaking it.\n'); - done(); - }); - }); - - describe('when new project name already exists', () => { - beforeEach(() => { - try { - testHelper.createDummyProjectDirectory(); - } catch (e: any) { - if (e.code !== 'EEXIST') { - throw e; - } - } - }); - - afterEach(() => { - testHelper.deleteDummyProjectDirectory(); - }); - - test - .stderr() - .stdout() - .command(['new:project', '-n=test-project']) - .it('should throw error if name of the new project already exists', async (ctx,done) => { - expect(ctx.stderr).to.equal(`Error: Unable to create the project. We tried to use "test-project" as the directory of your new project but it already exists (${PROJECT_DIRECTORY_PATH}). Please specify a different name for the new project. For example, run the following command instead:\n\n asyncapi new project --name test-project-1\n\n`); - expect(ctx.stdout).to.equal(''); - done(); - }); - }); -}); -