Skip to content

Commit

Permalink
Add test case for optimize command
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSaini101 committed Jan 4, 2025
1 parent d9ca9c8 commit 0542dd7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions test/integration/optimize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ describe('optimize', () => {
expect(ctx.stderr).to.equal('');
done();
});
test
.stderr()
.stdout()
.command(['optimize', 'http://localhost:8080/dummySpecWithoutSecurity.yml --proxyHost=host --proxyPort=8080'])
.it('works when url is passed with proxyHost and proxyPort with invalid host ', (ctx, done) => {
expect(ctx.stdout).to.contain('');
expect(ctx.stderr).to.equal('error loading AsyncAPI document from url: Failed to download http://localhost:8080/dummySpecWithoutSecurity.yml --proxyHost=host --proxyPort=8080.\n');
done();
});
});

describe('with no arguments', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/validate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('validate', () => {
.stderr()
.stdout()
.command(['validate', 'http://localhost:8080/dummySpec.yml --proxyHost=host --proxyPort=8080'])
.it('works when url is passed with proxyHost and proxyPort with invalid host ', (ctx, done) => {
.it('should throw error when url is passed with proxyHost and proxyPort with invalid host ', (ctx, done) => {
expect(ctx.stdout).to.contain('');
expect(ctx.stderr).to.equal('error loading AsyncAPI document from url: Failed to download http://localhost:8080/dummySpec.yml --proxyHost=host --proxyPort=8080.\n');
done();
Expand Down

0 comments on commit 0542dd7

Please sign in to comment.