mirror of
https://github.com/azures04/crafatar.git
synced 2026-05-06 11:00:39 +02:00
re-add checking for existing file before downloading
This commit is contained in:
28
test/test.js
28
test/test.js
@@ -133,23 +133,6 @@ describe('Crafatar', function() {
|
||||
done();
|
||||
});
|
||||
});
|
||||
it("should already have the files / not download", function(done) {
|
||||
|
||||
// FIXME: implement & remove this line
|
||||
throw("Please re-implement this and add a new test");
|
||||
|
||||
|
||||
assert.doesNotThrow(function() {
|
||||
fs.openSync("face.png", "w");
|
||||
fs.openSync("helm.png", "w");
|
||||
networking.get_skin("http://textures.minecraft.net/texture/477be35554684c28bdeee4cf11c591d3c88afb77e0b98da893fd7bc318c65184", function(err, img) {
|
||||
assert.strictEqual(err, null); // no error here, but it shouldn't throw exceptions
|
||||
fs.unlinkSync("face.png");
|
||||
fs.unlinkSync("helm.png");
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
it("should default to Alex", function(done) {
|
||||
assert.strictEqual(skins.default_skin("ec561538f3fd461daff5086b22154bce"), "alex");
|
||||
done();
|
||||
@@ -218,13 +201,4 @@ describe('Crafatar', function() {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
after(function() {
|
||||
try {
|
||||
// these files could be here if a test failed
|
||||
fs.unlinkSync("face.png");
|
||||
fs.unlinkSync("helm.png");
|
||||
} catch(e){}
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user