mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
clean up JS
This commit is contained in:
parent
ed7ca10960
commit
4d1f4466fd
18
test/test.js
18
test/test.js
@ -45,8 +45,8 @@ describe("Crafatar", function() {
|
|||||||
cache.get_redis().flushall();
|
cache.get_redis().flushall();
|
||||||
// largest possible integers, cause I don't know
|
// largest possible integers, cause I don't know
|
||||||
// how big hard drives are these days
|
// how big hard drives are these days
|
||||||
config.cleaning_disk_limit = Math.pow(2, 32) - 1;;
|
config.cleaning_disk_limit = Math.pow(2, 32) - 1;
|
||||||
config.cleaning_redis_limit = Math.pow(2, 32) - 1;;
|
config.cleaning_redis_limit = Math.pow(2, 32) - 1;
|
||||||
cleaner.run();
|
cleaner.run();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ describe("Crafatar", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// testing all paths for valid inputs
|
// testing all paths for valid inputs
|
||||||
var locations = ["avatars", "skins", "renders/head"]
|
var locations = ["avatars", "skins", "renders/head"];
|
||||||
for (var l in locations) {
|
for (var l in locations) {
|
||||||
var location = locations[l];
|
var location = locations[l];
|
||||||
(function(location) {
|
(function(location) {
|
||||||
@ -251,7 +251,7 @@ describe("Crafatar", function() {
|
|||||||
assert.equal(200, res.statusCode);
|
assert.equal(200, res.statusCode);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
it("should return a 422 (invalid id " + location + ")", function(done) {
|
it("should return a 422 (invalid id " + location + ")", function(done) {
|
||||||
request.get("http://localhost:3000/" + location + "/thisisaninvaliduuid", function(error, res, body) {
|
request.get("http://localhost:3000/" + location + "/thisisaninvaliduuid", function(error, res, body) {
|
||||||
assert.equal(422, res.statusCode);
|
assert.equal(422, res.statusCode);
|
||||||
@ -262,8 +262,8 @@ describe("Crafatar", function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// testing all paths for invalid id formats
|
// testing all paths for invalid id formats
|
||||||
var locations = ["avatars", "capes", "skins", "renders/head"]
|
locations = ["avatars", "capes", "skins", "renders/head"];
|
||||||
for (var l in locations) {
|
for (l in locations) {
|
||||||
var location = locations[l];
|
var location = locations[l];
|
||||||
(function(location) {
|
(function(location) {
|
||||||
it("should return a 422 (invalid id " + location + ")", function(done) {
|
it("should return a 422 (invalid id " + location + ")", function(done) {
|
||||||
@ -276,8 +276,8 @@ describe("Crafatar", function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//testing all paths for default images
|
//testing all paths for default images
|
||||||
locations = ["avatars", "skins", "renders/head"]
|
locations = ["avatars", "skins", "renders/head"];
|
||||||
for (var l in locations) {
|
for (l in locations) {
|
||||||
var location = locations[l];
|
var location = locations[l];
|
||||||
(function(location) {
|
(function(location) {
|
||||||
it("should return a 404 (default steve image " + location + ")", function(done) {
|
it("should return a 404 (default steve image " + location + ")", function(done) {
|
||||||
@ -298,7 +298,7 @@ describe("Crafatar", function() {
|
|||||||
after(function(done) {
|
after(function(done) {
|
||||||
server.close(function() {
|
server.close(function() {
|
||||||
done();
|
done();
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user