[fix] properly support iojs with test checking for HTTPS

This commit is contained in:
Jarrett Cruger 2015-04-02 12:30:55 -04:00
parent 6201ac76f7
commit c6dfb04a67

View File

@ -1,4 +1,5 @@
var httpProxy = require('../lib/http-proxy'),
semver = require('semver'),
expect = require('expect.js'),
http = require('http')
https = require('https'),
@ -166,7 +167,7 @@ describe('lib/http-proxy.js', function() {
proxy.on('error', function (err, req, res) {
expect(err).to.be.an(Error);
if (process.versions.node.indexOf('0.12.') == 0) {
if (semver.gt(process.versions.node, '0.12.0')) {
expect(err.toString()).to.be('Error: self signed certificate')
} else {
expect(err.toString()).to.be('Error: DEPTH_ZERO_SELF_SIGNED_CERT')