From 46acb17aa621124fba70647ae8e64364c4419d2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uli=20K=C3=B6hler?= Date: Wed, 23 Oct 2013 17:35:05 +0200 Subject: [PATCH] Added regression test for copy() return callback on error --- test/copy.test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/copy.test.js b/test/copy.test.js index fc05f52..67b4991 100644 --- a/test/copy.test.js +++ b/test/copy.test.js @@ -47,6 +47,17 @@ describe('fs-extra', function() { done() }) }) + + it('should return an error if the source file does not exist', function(done) { + var fileSrc = "we-simply-assume-this-file-does-not-exist.bin" + , fileDest = path.join(DIR, "TEST_fs-extra_copy") + , destMd5 = ''; + + fs.copy(fileSrc, fileDest, function(err) { + T (err); + done() + }) + }) it("should only copy files allowed by filter regex", function(done) { var srcFile1 = testutil.createFileWithData(path.join(DIR, "1.jade"), SIZE);