mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-22 07:51:17 +01:00
add test for timing out on username info (#14)
This commit is contained in:
parent
464c1eab98
commit
148ea45631
13
test/test.js
13
test/test.js
@ -144,10 +144,19 @@ describe('Crafatar', function() {
|
|||||||
done();
|
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;
|
var original_timeout = config.http_timeout;
|
||||||
config.http_timeout = 1;
|
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");
|
assert.strictEqual(err.code, "ETIMEDOUT");
|
||||||
config.http_timeout = original_timeout;
|
config.http_timeout = original_timeout;
|
||||||
done();
|
done();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user