Skip to content

Commit 1e0ef95

Browse files
committed
Badly written unit test doesn't work on Node 0.10.
1 parent 5e4a6c0 commit 1e0ef95

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

test/ntp-client_test.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
done();
2929
};
3030

31-
exports.works = function (test) {
31+
exports.validNTPServer = function (test) {
3232
ntpClient.ntpReplyTimeout = 5000; // Reducing timeout to avoid warnings.
3333

3434
ntpClient.getNetworkTime(ntpClient.defaultNtpServer, ntpClient.defaultNtpPort, function (err, date) {
@@ -44,14 +44,17 @@
4444

4545
// I won't test returned datetime against the system datetime
4646
// this is the whole purpose of NTP : putting clocks in sync.
47-
});
48-
49-
// I'm pretty sure there is no NTP Server listening at google.com
50-
ntpClient.getNetworkTime("google.com", 123, function (err, date) {
51-
test.ok(err !== null);
52-
test.ok(date === null);
53-
test.equal(err, "Timeout waiting for NTP response.");
5447
test.done();
5548
});
49+
50+
exports.invalidNTPServer = function (test) {
51+
// I'm pretty sure there is no NTP Server listening at google.com
52+
ntpClient.getNetworkTime("google.com", 123, function (err, date) {
53+
test.ok(err !== null);
54+
test.ok(date === null);
55+
test.equal(err, "Timeout waiting for NTP response.");
56+
test.done();
57+
});
58+
};
5659
};
5760
}(exports));

0 commit comments

Comments
 (0)