Skip to content

Commit

Permalink
tests: options fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRalphson committed Oct 14, 2020
1 parent 36cce83 commit d01f227
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion test/http2.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const fs = require('fs');
const path = require('path');
const assert = require('assert');
const https = require('https');
const http2 = require('http2');
const mime = require('mime-types');
const yaml = require('yaml');
Expand All @@ -27,6 +28,10 @@ const serverOptions = {
const server = http2.createSecureServer(serverOptions);
const serverRoot = path.join(__dirname,'http2');

const agent = new https.Agent({
rejectUnauthorized: false
});

function respondToStreamError(err, stream) {
console.warn(err);
if (err.code === 'ENOENT') {
Expand Down Expand Up @@ -68,7 +73,7 @@ tests.forEach((test) => {
const input = yaml.parse(fs.readFileSync(inputSpec,'utf8'),{schema:'core'});
const output = yaml.parse(fs.readFileSync(path.join(__dirname, 'http2', test, 'output.yaml'),'utf8'),{schema:'core'});

let options = { resolve: true, preserveMiro: false, source: inputSpec };
let options = { resolve: true, preserveMiro: false, source: inputSpec, agent, verbose: true };
try {
options = Object.assign({},options,yaml.parse(fs.readFileSync(path.join(__dirname, 'http2', test, 'options.yaml'),'utf8'),{schema:'core'}));
}
Expand Down
4 changes: 2 additions & 2 deletions test/s2o.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ tests.forEach((test) => {
const openapi = yaml.parse(fs.readFileSync(path.join(__dirname, 's2o-test', test, 'openapi.yaml'),'utf8'),{schema:'core'});

let options = {};
options.source = path.join(__dirname, 's2o-test', test, 'swagger.yaml');
try {
options = yaml.parse(fs.readFileSync(path.join(__dirname, 's2o-test', test, 'options.yaml'),'utf8'),{schema:'core'});
options.source = path.join(__dirname, 's2o-test', test, 'swagger.yaml');
options = Object.assign({},options,yaml.parse(fs.readFileSync(path.join(__dirname, 's2o-test', test, 'options.yaml'),'utf8'),{schema:'core'}));
}
catch (ex) {}

Expand Down

0 comments on commit d01f227

Please sign in to comment.