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
Changes from 1 commit
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
Prev Previous commit
test(write): integrity error test case
larsgw committed Oct 4, 2018
commit fbdb13e8c49e71524ade2174ec0c515d4c3c8d98
10 changes: 10 additions & 0 deletions test/put.js
Original file line number Diff line number Diff line change
@@ -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, {