From 148ea4563108febe5856744a341d691ab9b09848 Mon Sep 17 00:00:00 2001 From: jomo Date: Sun, 23 Nov 2014 22:01:11 +0100 Subject: [PATCH] add test for timing out on username info (#14) --- test/test.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index 032f42a..23dcfc8 100644 --- a/test/test.js +++ b/test/test.js @@ -144,10 +144,19 @@ describe('Crafatar', function() { done(); }); }); - it("should time out on profile download", function(done) { + it("should time out on uuid info download", function(done) { var original_timeout = config.http_timeout; config.http_timeout = 1; - networking.get_skin_url("069a79f444e94726a5befca90e38aaf5", function(err, profile) { + networking.get_skin_url("069a79f444e94726a5befca90e38aaf5", function(err, skin_url) { + assert.strictEqual(err.code, "ETIMEDOUT"); + config.http_timeout = original_timeout; + done(); + }); + }); + it("should time out on username info download", function(done) { + var original_timeout = config.http_timeout; + config.http_timeout = 1; + networking.get_skin_url("redstone_sheep", function(err, skin_url) { assert.strictEqual(err.code, "ETIMEDOUT"); config.http_timeout = original_timeout; done();