diff --git a/test/bionode-ncbi.js b/test/bionode-ncbi.js index 9010aa9..a414571 100644 --- a/test/bionode-ncbi.js +++ b/test/bionode-ncbi.js @@ -28,33 +28,33 @@ test('Download list', function(t) { }) -// test('Download', function(t) { -// t.plan(2) -// -// async.eachSeries( -// [ -// 'should take a database name and search term, and download datasets', -// 'repeat same download to cover already downloaded branch' -// ], -// testDownload -// ) -// -// function testDownload(msg, cb) { -// var path -// ncbi.download('assembly', 'Guillardia theta') -// .on('data', function(data) { path = data.path }) -// .on('end', function() { -// var file = fs.ReadStream(path) -// var shasum = crypto.createHash('sha1') -// file.on('data', function(d) { shasum.update(d) }) -// file.on('end', function() { -// var sha1 = shasum.digest('hex'); -// t.equal(sha1, 'a2dc7b3b0ae6f40d5205c4394c2fe8bc65d52bc2', msg) -// cb() -// }) -// }) -// } -// }) +test('Download', function(t) { + t.plan(2) + + async.eachSeries( + [ + 'should take a database name and search term, and download datasets', + 'repeat same download to cover already downloaded branch' + ], + testDownload + ) + + function testDownload(msg, cb) { + var path + ncbi.download('assembly', 'Guillardia theta') + .on('data', function(data) { path = data.path }) + .on('end', function() { + var file = fs.ReadStream(path) + var shasum = crypto.createHash('sha1') + file.on('data', function(d) { shasum.update(d) }) + file.on('end', function() { + var sha1 = shasum.digest('hex'); + t.equal(sha1, 'a2dc7b3b0ae6f40d5205c4394c2fe8bc65d52bc2', msg) + cb() + }) + }) + } +}) test('Search', function(t) {