Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Add ssri config 'error' option #146

Merged
merged 2 commits into from
Jun 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions put.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const PutOpts = figgyPudding({
gid: {},
single: {},
sep: {},
error: {},
strict: {}
})

Expand Down
10 changes: 10 additions & 0 deletions test/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down