Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3 from uber/bug/cannot.run.multiple.servers.sqwished
Browse files Browse the repository at this point in the history
Added fix for mutliple server regression
  • Loading branch information
twolfson committed Jan 5, 2014
2 parents 09c7cbc + f5ba6f5 commit 1c6d980
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/fixed-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,12 @@ FixedServerFactory.prototype = {
var server = this.createServer(fixtureNames);
var that = this;
before(function () {
// Create local fake server
server.listen(that.options.port);
this.server = server;
});
after(function (done) {
this.server.destroy(done);
server.destroy(done);
});
return server;
}
};

Expand Down
10 changes: 10 additions & 0 deletions test/fixed-server_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,13 @@ describe('A FixedServer loaded from a file', function () {
expect(JSON.parse(this.body)).to.deep.equal([{data:true}]);
});
});

// DEV: Regression test for https://github.com/uber/fixed-server/issues/2
describe('Multiple FixedServers run in the same test', function () {
(new FixedServer(serverOptions)).run();
(new FixedServer(extend({}, serverOptions, {port: 1338}))).run();

it('do not conflict while shutting down', function () {
// DEV: This is automatic since the regression was in the mocha helpers
});
});

0 comments on commit 1c6d980

Please sign in to comment.