Skip to content

Commit

Permalink
fix: issue with bundle command (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
Souvikns authored Jul 26, 2023
1 parent a874a1a commit be6186f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class Bundle extends Command {
}

if (format === '.json') {
await writeFile(path.resolve(process.cwd(), output), document.json(), {
await writeFile(path.resolve(process.cwd(), output), document.string(), {
encoding: 'utf-8',
});
}
Expand Down
14 changes: 14 additions & 0 deletions test/commands/bundle/bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ describe('bundle', () => {
done();
});

test
.stdout()
.command([
'bundle', './test/commands/bundle/first-asyncapi.yaml',
'--output=./test/commands/bundle/final.json'
])
.it('should successfully bundle specification into json file', (ctx, done) => {
expect(ctx.stdout).toContain(
'Check out your shiny new bundled files at ./test/commands/bundle/final.json'
);
fileCleanup('./test/commands/bundle/final.json');
done();
});

test
.stderr()
.command([
Expand Down

0 comments on commit be6186f

Please sign in to comment.