Skip to content

Commit c097f41

Browse files
committed
Mocha waits for done callback before exiting an asycnhronous test. This fixes another later test failing due to a problem in asynchronous http.get().
1 parent 2524d21 commit c097f41

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/indexTest.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ describe("Port function",function(){
1414
assert(typeof myport, "number");
1515
});
1616

17-
it("Port value should be >= 0 and < 65536",function () {
18-
http.get(`http://localhost:${dataApp.prototype.port}`, function (response) {
19-
assert.equal(response.statusCode, 200);
17+
it("Port value should be >= 0 and < 65536",function(done){
18+
http.get(`http://localhost:${dataApp.prototype.port}`, function (response) {
19+
assert.equal(response.statusCode, 200);
20+
done();
2021
});
2122
});
2223
});

0 commit comments

Comments
 (0)