Why does only one test seem to be processed

This commit is contained in:
Jake 2015-02-11 18:25:56 -06:00
parent 2c1173b8a5
commit 5a06e99643
2 changed files with 114 additions and 110 deletions

View File

@ -45,8 +45,12 @@ module.exports = function(req, res) {
userId = userId.replace(/-/g, "");
logging.log(rid + "userid: " + userId);
console.log("THIS WAS CALLED")
try {
console.log("TRIED")
helpers.get_avatar(rid, userId, helm, size, function(err, status, image, hash) {
console.log("I DID RUN COVERALLS!!")
logging.log(rid + "storage type: " + human_status[status]);
if (err) {
logging.error(rid + err);
@ -72,6 +76,7 @@ module.exports = function(req, res) {
}
});
} catch(e) {
console.log("FAILED")
logging.error(rid + "error: " + e.stack);
handle_default(rid, 500, -1, userId);
}

View File

@ -1,6 +1,5 @@
var assert = require("assert");
var fs = require("fs");
var networking = require("../modules/networking");
var helpers = require("../modules/helpers");
var logging = require("../modules/logging");
@ -32,10 +31,10 @@ function getRandomInt(min, max) {
}
var ids = [
uuid.toLowerCase(),
name.toLowerCase(),
uuid.toUpperCase(),
name.toUpperCase(),
uuid.toLowerCase(),
name.toLowerCase(),
name.toUpperCase(),
uuid.toUpperCase(),
];
describe("Crafatar", function() {
@ -102,7 +101,7 @@ describe("Crafatar", function() {
});
});
});
describe("Avatar", function() {
describe("Avatar", function() {
// profile "Alex" - hoping it'll never have a skin
var alex_uuid = "ec561538f3fd461daff5086b22154bce";
// profile "Steven" (Steve doesn't exist) - hoping it'll never have a skin
@ -126,7 +125,7 @@ describe("Avatar", function() {
done();
});
});
describe("Errors", function() {
describe("Errors", function() {
it("should time out on uuid info download", function(done) {
var original_timeout = config.http_timeout;
config.http_timeout = 1;
@ -174,9 +173,9 @@ describe("Errors", function() {
done();
});
});
});
});
describe("Server", function() {
describe("Server", function() {
before(function(done) {
server.boot(function() {
done();
@ -241,6 +240,12 @@ describe("Server", function() {
var locations = ["avatars", "capes", "skins", "renders/head"]
for (var l in locations) {
var location = locations[l];
it("should return a 200 (valid input " + location + ")", function(done) {
request.get("http://localhost:3000/" + location + "/Jake0oo0", function(error, res, body) {
assert.equal(200, res.statusCode);
done();
});
});
it("should return a 422 (invalid id " + location + ")", function(done) {
request.get("http://localhost:3000/" + location + "/thisisaninvaliduuid", function(error, res, body) {
assert.equal(422, res.statusCode);
@ -248,12 +253,6 @@ describe("Server", function() {
});
});
it("should return a 200 (valid input " + location + ")", function(done) {
request.get("http://localhost:3000/" + location + "/Jake0oo0", function(error, res, body) {
assert.equal(200, res.statusCode);
done();
});
});
}
// testing all paths for default images
@ -380,16 +379,16 @@ describe("Server", function() {
}
});
describe("Networking: Skin", function() {
describe("Networking: Skin", function() {
it("should not fail (uuid)", function(done) {
helpers.get_skin(rid, id, function(err, hash, img) {
assert.strictEqual(err, null);
done();
});
});
});
});
describe("Networking: Render", function() {
describe("Networking: Render", function() {
it("should not fail (full body)", function(done) {
helpers.get_render(rid, id, 6, true, true, function(err, hash, img) {
assert.strictEqual(err, null);
@ -402,19 +401,19 @@ describe("Networking: Render", function() {
done();
});
});
});
});
describe("Networking: Cape", function() {
describe("Networking: Cape", function() {
it("should not fail (possible cape)", function(done) {
helpers.get_cape(rid, id, function(err, hash, img) {
assert.strictEqual(err, null);
done();
});
});
});
});
describe("Errors", function() {
describe("Errors", function() {
before(function() {
cache.get_redis().flushall();
});
@ -434,7 +433,7 @@ describe("Errors", function() {
});
});
}
});
})(id, id_type);
}
});
})(id, id_type);
}
});