diff --git a/put.js b/put.js index a60cc55..cb4057f 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 8658be9..4762643 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, {