Skip to content

Commit

Permalink
windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nomilous committed Nov 2, 2016
1 parent 57c4f32 commit dd33fa6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/c8_listen.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ describe('c8_deferred_listen', function () {
var happn = require('../lib/index')
var service = happn.service;
var happn_client = happn.client;
var os = require('os');

this.timeout(120000);

Expand Down Expand Up @@ -64,7 +65,7 @@ describe('c8_deferred_listen', function () {

var happnInstance;

it('should initialize the service without listening', function (callback) {
before('should initialize the service without listening', function (callback) {

service.create({
deferListen: true
Expand Down Expand Up @@ -133,6 +134,15 @@ describe('c8_deferred_listen', function () {
it('should try and start the service, but fail with EADDRINUSE, then kill the http server, then successfully retry', function (callback) {
happnInstance.listen(function (e) {

if (!e && os.platform() == 'win32') {
console.log(happnInstance.server.address()); // { address: '0.0.0.0', family: 'IPv4', port: 55000 }
console.log(httpServer.server.address()); // { address: '::', family: 'IPv6', port: 55000 }

// apparently that's possible on windows (2012 server)

return done();
}

//cannot listen
expect(e.code).to.be("EADDRINUSE");

Expand Down

0 comments on commit dd33fa6

Please sign in to comment.