Comparing version 1.0.9 to 1.0.10
@@ -49,2 +49,3 @@ const fs = require('fs'); | ||
return new Promise((resolve, reject) => { | ||
var ret = {zip, fn: dest + '/' + fn}; | ||
z.on('error', (err) => { | ||
@@ -51,0 +52,0 @@ reject(Object.assign(ret, {src: 'on', err})); |
{ | ||
"name": "ofac", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "A module to facilitate local OFAC searches", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -57,2 +57,24 @@ var fs = require('fs'); | ||
}) | ||
it('File does not exist', () => { | ||
return ofac.zipExtract(zip + '-fail', fn, '/tmp') | ||
.then(() => { | ||
assert.ok(false, 'Should have failed') | ||
}) | ||
.catch(e => { | ||
var expected = { | ||
zip: "t/sdn.xml.zip-fail", | ||
fn: "/tmp/sdn.xml", | ||
src: "on", | ||
err: { | ||
errno: -2, | ||
code: "ENOENT", | ||
syscall: "open", | ||
path: "t/sdn.xml.zip-fail" | ||
} | ||
}; | ||
e = JSON.parse(JSON.stringify(e)) // errors stringify differently | ||
assert.deepEqual(e, expected, 'Did not fail when it should have') | ||
}) | ||
}) | ||
it('Extraction', async () => { | ||
@@ -59,0 +81,0 @@ var path = '/tmp/' + fn; |
27023
285