From dc59e9caafab1457b71591697795f90a77956345 Mon Sep 17 00:00:00 2001 From: souvik Date: Fri, 2 Feb 2024 19:19:19 +0530 Subject: [PATCH] fix: removing v3 check for bundle command --- src/commands/bundle.ts | 7 ------- test/integration/bundle/bundle.test.ts | 17 +---------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/commands/bundle.ts b/src/commands/bundle.ts index d014fbbe2ff..dfd73401cf4 100644 --- a/src/commands/bundle.ts +++ b/src/commands/bundle.ts @@ -33,13 +33,6 @@ export default class Bundle extends Command { const outputFormat = path.extname(argv[0]); const AsyncAPIFiles = await this.loadFiles(argv); - const containsAsyncAPI3 = AsyncAPIFiles.filter((file) => { - return file.isAsyncAPI3(); - }); - if (containsAsyncAPI3.length > 0) { - this.error('One of the files you tried to bundle is AsyncAPI v3 format, the bundle command does not support it yet, please checkout https://github.com/asyncapi/bundler/issues/133'); - } - if (flags.base) {baseFile = (await load(flags.base)).text();} const fileContents = AsyncAPIFiles.map((file) => file.text()); diff --git a/test/integration/bundle/bundle.test.ts b/test/integration/bundle/bundle.test.ts index dcfe4de72d1..8134b117f21 100644 --- a/test/integration/bundle/bundle.test.ts +++ b/test/integration/bundle/bundle.test.ts @@ -4,7 +4,7 @@ import path from 'path'; import { fileCleanup } from '../../helpers'; const spec = fs.readFileSync('./test/integration/bundle/final-asyncapi.yaml', {encoding: 'utf-8'}); -const asyncapiv3 = './test/fixtures/specification-v3.yml'; +//const asyncapiv3 = './test/fixtures/specification-v3.yml'; function validateGeneratedSpec(filePath: string, spec: string) { const generatedSPec = fs.readFileSync(path.resolve(filePath), { encoding: 'utf-8' }); @@ -12,21 +12,6 @@ function validateGeneratedSpec(filePath: string, spec: string) { } describe('bundle', () => { - describe('should handle AsyncAPI v3 document correctly', () => { - test - .stderr() - .stdout() - .command([ - 'bundle', - asyncapiv3, - '--output=./test/integration/bundle/final.yaml']) - .it('give error', (ctx, done) => { - expect(ctx.stderr).to.equal('Error: One of the files you tried to bundle is AsyncAPI v3 format, the bundle command does not support it yet, please checkout https://github.com/asyncapi/bundler/issues/133\n'); - expect(ctx.stdout).to.equal(''); - done(); - }); - }); - test .stdout() .command([