Browse Source

some more test fixes

http2
Sindre Sorhus 9 years ago
parent
commit
28ddd68a7c
  1. 2
      package.json
  2. 9
      test/_server.js
  3. 1
      test/arguments.js
  4. 2
      test/https.js

2
package.json

@ -61,7 +61,7 @@
"url-parse-lax": "^1.0.0"
},
"devDependencies": {
"ava": "^0.3.0",
"ava": "^0.4.1",
"coveralls": "^2.11.4",
"get-port": "^2.0.0",
"into-stream": "^2.0.0",

9
test/_server.js

@ -3,6 +3,7 @@ var http = require('http');
var https = require('https');
var pify = require('pify');
var getPort = require('get-port');
var Promise = require('pinkie-promise');
var host = exports.host = 'localhost';
exports.createServer = function () {
@ -16,8 +17,8 @@ exports.createServer = function () {
s.url = 'http://' + host + ':' + port;
s.protocol = 'http';
s.listen = pify(s.listen);
s.close = pify(s.close);
s.listen = pify(s.listen, Promise);
s.close = pify(s.close, Promise);
return s;
});
@ -34,8 +35,8 @@ exports.createSSLServer = function (opts) {
s.url = 'https://' + host + ':' + port;
s.protocol = 'https';
s.listen = pify(s.listen);
s.close = pify(s.close);
s.listen = pify(s.listen, Promise);
s.close = pify(s.close, Promise);
return s;
});

1
test/arguments.js

@ -1,5 +1,4 @@
import test from 'ava';
import pify from 'pify';
import got from '../';
import {createServer} from './_server';

2
test/https.js

@ -10,7 +10,7 @@ let cert;
let caRootKey;
let caRootCert;
const pemP = pify(pem);
const pemP = pify(pem, Promise);
test.before('setup', async t => {
const caKeys = await pemP.createCertificate({days: 1, selfSigned: true});

Loading…
Cancel
Save