diff --git a/put.js b/put.js index 01b0dd8..25cace2 100644 --- a/put.js +++ b/put.js @@ -20,6 +20,7 @@ const PutOpts = figgyPudding({ gid: {}, single: {}, sep: {}, + error: {}, strict: {} }) diff --git a/test/put.js b/test/put.js index ac182f9..35ed4c6 100644 --- a/test/put.js +++ b/test/put.js @@ -102,6 +102,16 @@ test('optionally memoizes data on stream insertion', t => { }) }) +test('errors if integrity errors', t => { + return BB.join( + put(CACHE, KEY, CONTENT, { + integrity: 'sha1-BaDDigEST' + }).catch(err => { + t.equal(err.code, 'EINTEGRITY', 'got error from bad integrity') + }) + ) +}) + test('signals error if error writing to cache', t => { return BB.join( put(CACHE, KEY, CONTENT, {