forked from signalapp/Signal-Desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase_test.js
39 lines (31 loc) · 876 Bytes
/
database_test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
/* global Whisper */
'use strict';
describe('Database', () => {
describe('handleDOMException', () => {
it('handles null, still calls reject', () => {
let called = 0;
const reject = () => {
called += 1;
};
const error = null;
const prefix = 'something';
Whisper.Database.handleDOMException(prefix, error, reject);
assert.strictEqual(called, 1);
});
it('handles object code and message', () => {
let called = 0;
const reject = () => {
called += 1;
};
const error = {
code: 4,
message: 'some cryptic error',
};
const prefix = 'something';
Whisper.Database.handleDOMException(prefix, error, reject);
assert.strictEqual(called, 1);
});
});
});