22var expect = require ( 'expect.js' ) ;
33var eio = require ( '../' ) ;
44
5+ var expectedPort = global . location && 'https:' === location . protocol ? '443' : '80' ;
6+
57describe ( 'engine.io-client' , function ( ) {
68 var open ;
79
@@ -45,7 +47,7 @@ describe('engine.io-client', function () {
4547 it ( 'should properly parse a host without port' , function ( ) {
4648 var client = eio ( { host : 'localhost' } ) ;
4749 expect ( client . hostname ) . to . be ( 'localhost' ) ;
48- expect ( client . port ) . to . be ( '80' ) ;
50+ expect ( client . port ) . to . be ( expectedPort ) ;
4951 } ) ;
5052
5153 it ( 'should properly parse a host with port' , function ( ) {
@@ -69,7 +71,7 @@ describe('engine.io-client', function () {
6971 it ( 'should properly parse an IPv6 host without port (1/2)' , function ( ) {
7072 var client = eio ( { host : '[::1]' } ) ;
7173 expect ( client . hostname ) . to . be ( '::1' ) ;
72- expect ( client . port ) . to . be ( '80' ) ;
74+ expect ( client . port ) . to . be ( expectedPort ) ;
7375 } ) ;
7476
7577 it ( 'should properly parse an IPv6 host without port (2/2)' , function ( ) {
@@ -87,6 +89,6 @@ describe('engine.io-client', function () {
8789 it ( 'should properly parse an IPv6 host without brace' , function ( ) {
8890 var client = eio ( { host : '::1' } ) ;
8991 expect ( client . hostname ) . to . be ( '::1' ) ;
90- expect ( client . port ) . to . be ( '80' ) ;
92+ expect ( client . port ) . to . be ( expectedPort ) ;
9193 } ) ;
9294} ) ;
0 commit comments