From 58ec386096944dbac494455b4c9896cd7c7aef51 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Tue, 8 Sep 2015 08:28:08 -0400 Subject: [PATCH] add string test back in --- test/test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/test.js b/test/test.js index c9394cd..710007d 100644 --- a/test/test.js +++ b/test/test.js @@ -209,6 +209,23 @@ function tests(dbName, dbType) { }); }); + it('should dump to a string', function () { + + var MemoryStream = require('memorystream'); + + var dumpedString = ''; + var readStream = new MemoryStream(); + readStream.on('data', function (chunk) { + dumpedString += chunk.toString(); + }); + + return db.put({_id: '1'}).then(function () { + return db.dump(readStream); + }).then(function () { + dumpedString.should.be.a('string', 'got a string'); + }); + }); + it('should dump and load using string', function () { var dumpedString = ''; var readStream = new MemoryStream();