<NME> memory.js
<BEF> var Filer = require('../../src');

function MemoryTestProvider(name) {
  var that = this;

  function cleanup(callback) {
    that.provider = null;
    callback();
  }

  function init() {
    if(that.provider) {
      return;
    }
    that.provider = new Filer.FileSystem.providers.Memory(name);
  }

  this.init = init;
  this.cleanup = cleanup;
}
MemoryTestProvider.isSupported = function() {
  return Filer.FileSystem.providers.Memory.isSupported();
};

module.exports = MemoryTestProvider;

<MSG> Ensure test providers deal with missing callback early

<DFF> @@ -4,6 +4,8 @@ function MemoryTestProvider(name) {
   var that = this;
 
   function cleanup(callback) {
+    callback = callback || function(){};
+
     that.provider = null;
     callback();
   }

{'commit': 'diff --git a/tests/lib/indexeddb.js b/tests/lib/indexeddb.js\nindex 251729f..77ff3ea 100644\n--- a/tests/lib/indexeddb.js\n+++ b/tests/lib/indexeddb.js\n@@ -17,6 +17,8 @@ function IndexedDBTestProvider(name) {\n   var that = this;\n \n   function cleanup(callback) {\n+    callback = callback || function(){};\n+\n     if(!that.provider || _done) {\n       return callback();\n     }\n@@ -27,7 +29,6 @@ function IndexedDBTestProvider(name) {\n       that.provider.db.close();\n     }\n \n-    callback = callback || function(){};\n     var request = indexedDB.deleteDatabase(name);\n     function finished() {\n       that.provider = null;\ndiff --git a/tests/lib/memory.js b/tests/lib/memory.js\nindex 19d25b6..ccfa2cd 100644\n--- a/tests/lib/memory.js\n+++ b/tests/lib/memory.js\n@@ -4,6 +4,8 @@ function MemoryTestProvider(name) {\n   var that = this;\n \n   function cleanup(callback) {\n+    callback = callback || function(){};\n+\n     that.provider = null;\n     callback();\n   }\ndiff --git a/tests/lib/websql.js b/tests/lib/websql.js\nindex 9bc7c93..5d2a189 100644\n--- a/tests/lib/websql.js\n+++ b/tests/lib/websql.js\n@@ -12,9 +12,12 @@ function WebSQLTestProvider(name) {\n   var that = this;\n \n   function cleanup(callback) {\n+    callback = callback || function(){};\n+\n     if(!that.provider || _done) {\n       return callback();\n     }\n+\n     // Provider is there, but db was never touched\n     if(!that.provider.db) {\n       return callback();\n', 'commit_subject': 'Ensure test providers deal with missing callback early', 'repo_name': 'filerjs/filer', 'committer': {'name': 'David Humphrey (:humph) david.humphrey@senecacollege.ca', 'email': '3027051b1868edf67c5e1bcc47e81592114b743c@senecacollege.ca', 'time_sec': '1417102309', 'tz_offset': '-300', 'date': {'seconds': '1417102309'}}, 'commit_tree': 'd3d2d1a0488c2ff52e92e9198b1ffab1f9d3ed63', 'commit_message': 'Ensure test providers deal with missing callback early\n', 'language_name': 'HTML', 'license': 'bsd-2-clause', 'hunks': '@@ -4,6 +4,8 @@ function MemoryTestProvider(name) {\n   var that = this;\n \n   function cleanup(callback) {\n+    callback = callback || function(){};\n+\n     that.provider = null;\n     callback();\n   }\n', 'addition_count': 2, 'deletion_count': 0, 'src_file': 'a/tests/lib/memory.js', 'tgt_file': 'b/tests/lib/memory.js', 'file_extension': '.js', 'before_file': "var Filer = require('../../src');\n\nfunction MemoryTestProvider(name) {\n  var that = this;\n\n  function cleanup(callback) {\n    that.provider = null;\n    callback();\n  }\n\n  function init() {\n    if(that.provider) {\n      return;\n    }\n    that.provider = new Filer.FileSystem.providers.Memory(name);\n  }\n\n  this.init = init;\n  this.cleanup = cleanup;\n}\nMemoryTestProvider.isSupported = function() {\n  return Filer.FileSystem.providers.Memory.isSupported();\n};\n\nmodule.exports = MemoryTestProvider;\n", 'message': 'Ensure test providers deal with missing callback early\n', 'author_name': 'David Humphrey (:humph) david.humphrey@senecacollege.ca', 'lang': 'js'}