Browse Source

test improvements, fix #14

jomo 10 years ago
parent
commit
ea3f322c73
1 changed files with 14 additions and 10 deletions
  1. 14 10
      test/test.js

+ 14 - 10
test/test.js

@@ -125,13 +125,15 @@ describe('Crafatar', function() {
       });
     });
     it("should already have the files / not download", function(done) {
-      fs.openSync("face.png", "w");
-      fs.openSync("helm.png", "w");
-      networking.skin_file("http://textures.minecraft.net/texture/477be35554684c28bdeee4cf11c591d3c88afb77e0b98da893fd7bc318c65184", "face.png", "helm.png", function(err) {
-        assert.strictEqual(err, null); // no error here, but it shouldn't throw exceptions
-        fs.unlinkSync("face.png");
-        fs.unlinkSync("helm.png");
-        done();
+      assert.doesNotThrow(function() {
+        fs.openSync("face.png", "w");
+        fs.openSync("helm.png", "w");
+        networking.skin_file("http://textures.minecraft.net/texture/477be35554684c28bdeee4cf11c591d3c88afb77e0b98da893fd7bc318c65184", "face.png", "helm.png", function(err) {
+          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) {
@@ -182,9 +184,11 @@ describe('Crafatar', function() {
       });
     });
     it("should not find the skin", function(done) {
-      networking.skin_file("http://textures.minecraft.net/texture/this-does-not-exist", "face.png", "helm.png", function(err) {
-        assert.strictEqual(err, null); // no error here, but it shouldn't throw exceptions
-        done();
+      assert.doesNotThrow(function() {
+        networking.skin_file("http://textures.minecraft.net/texture/this-does-not-exist", "face.png", "helm.png", function(err) {
+          assert.strictEqual(err, null); // no error here, but it shouldn't throw exceptions
+          done();
+        });
       });
     });
     it("should handle file updates on invalid files", function(done) {