Skip to content

Commit

Permalink
fix: removing v3 check for bundle command
Browse files Browse the repository at this point in the history
  • Loading branch information
Souvikns committed Feb 2, 2024
1 parent 1203493 commit dc59e9c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
7 changes: 0 additions & 7 deletions src/commands/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
17 changes: 1 addition & 16 deletions test/integration/bundle/bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,14 @@ 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' });
return generatedSPec === spec;
}

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([
Expand Down

0 comments on commit dc59e9c

Please sign in to comment.