We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7feae75 commit 42c93a9Copy full SHA for 42c93a9
test.js
@@ -113,3 +113,17 @@ test('throws error when document has attachments', function (t) {
113
t.ok(/Attachments cannot be encrypted/.test(e.message), 'throws error');
114
})
115
116
+test('wrong password', function (t) {
117
+ t.plan(1);
118
+ var dbName = 'nine';
119
+ var db = new PouchDB(dbName, {db: memdown});
120
+ db.crypto('correct')
121
+ db.put({foo: 'bar'}, 'baz').then(function () {
122
+ db.crypto('wrong')
123
+ return db.get('baz');
124
+ }).then(function (doc) {
125
+ t.fail('retrieved document with bad password')
126
+ }).catch(function (err) {
127
+ t.equals(err.message, 'unable to authenticate', ' fails setting up invalid password.')
128
+ })
129
+});
0 commit comments