mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
welp..fix
This commit is contained in:
parent
5a06e99643
commit
20d8b281bd
@ -1,7 +1,6 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
- "0.12"
|
||||
before_script:
|
||||
- cp "modules/config.example.js" "modules/config.js"
|
||||
before_install:
|
||||
|
||||
@ -45,12 +45,9 @@ 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);
|
||||
@ -76,7 +73,6 @@ module.exports = function(req, res) {
|
||||
}
|
||||
});
|
||||
} catch(e) {
|
||||
console.log("FAILED")
|
||||
logging.error(rid + "error: " + e.stack);
|
||||
handle_default(rid, 500, -1, userId);
|
||||
}
|
||||
|
||||
12
test/test.js
12
test/test.js
@ -240,38 +240,42 @@ describe("Crafatar", function() {
|
||||
var locations = ["avatars", "capes", "skins", "renders/head"]
|
||||
for (var l in locations) {
|
||||
var location = locations[l];
|
||||
(function(location) {
|
||||
if (location !== "capes") {
|
||||
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);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
})(location);
|
||||
}
|
||||
|
||||
//testing all paths for default images
|
||||
locations = ["avatars", "capes", "skins"]
|
||||
locations = ["avatars", "skins"]
|
||||
for (var l in locations) {
|
||||
var location = locations[l];
|
||||
(function(location) {
|
||||
it("should return a 404 (default steve image " + location + ")", function(done) {
|
||||
request.get("http://localhost:3000/" + location + "/invalidjsvns?default=steve", function(error, res, body) {
|
||||
assert.equal(404, res.statusCode);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should return a 200 (default external image " + location + ")", function(done) {
|
||||
request.get("http://localhost:3000/" + location + "/invalidjsvns?default=https%3A%2F%2Fi.imgur.com%2FocJVWAc.png", function(error, res, body) {
|
||||
assert.equal(200, res.statusCode);
|
||||
done();
|
||||
});
|
||||
});
|
||||
})(location);
|
||||
}
|
||||
|
||||
after(function(done) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user