mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
add more tests for usernames
This commit is contained in:
parent
bc8a6d9b15
commit
893ac91717
22
test/test.js
22
test/test.js
@ -8,8 +8,10 @@ var skins = require('../modules/skins');
|
||||
var cache = require("../modules/cache");
|
||||
|
||||
var uuids = fs.readFileSync('test/uuids.txt').toString().split("\n");
|
||||
// Get a random UUID in order to prevent rate limiting
|
||||
var uuid = uuids[Math.floor((Math.random() * 200) + 1)];
|
||||
var usernames = fs.readFileSync('test/usernames.txt').toString().split("\n");
|
||||
// Get a random UUID + username in order to prevent rate limiting
|
||||
var uuid = uuids[Math.round(Math.random() * (uuids.length - 1))];
|
||||
var username = usernames[Math.round(Math.random() * (usernames.length - 1))];
|
||||
|
||||
describe('Avatar Serving', function(){
|
||||
before(function() {
|
||||
@ -63,18 +65,30 @@ describe('Avatar Serving', function(){
|
||||
});
|
||||
});
|
||||
describe('Avatar', function(){
|
||||
it("should be downloaded", function(done) {
|
||||
it("should be downloaded (uuid)", function(done) {
|
||||
helpers.get_avatar(uuid, false, 160, function(err, status, image) {
|
||||
assert.strictEqual(status, 2);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it("should be local", function(done) {
|
||||
it("should be local (uuid)", function(done) {
|
||||
helpers.get_avatar(uuid, false, 160, function(err, status, image) {
|
||||
assert.strictEqual(status, 1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it("should be downloaded (username)", function(done) {
|
||||
helpers.get_avatar(username, false, 160, function(err, status, image) {
|
||||
assert.strictEqual(status, 2);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it("should be local (username)", function(done) {
|
||||
helpers.get_avatar(username, false, 160, function(err, status, image) {
|
||||
assert.strictEqual(status, 1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
describe('Mojang Errors', function(){
|
||||
before(function() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user