diff --git a/test/integration/optimize.test.ts b/test/integration/optimize.test.ts index 1f921e11669..d07e858f7aa 100644 --- a/test/integration/optimize.test.ts +++ b/test/integration/optimize.test.ts @@ -58,6 +58,15 @@ describe('optimize', () => { expect(ctx.stderr).to.equal(''); done(); }); + test + .stderr() + .stdout() + .command(['optimize', 'http://localhost:8080/dummySpec.yml --proxyHost=host --proxyPort=8080']) + .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(); + }); }); describe('with no arguments', () => {