Refactor: db tasks to database.js, log delete to modules/logs.js

This commit is contained in:
Scott Nonnenberg 2018-03-07 16:16:03 -08:00 committed by Scott Nonnenberg
parent 3527740598
commit 26c273618a
No known key found for this signature in database
GPG key ID: 5F82280C35134661
10 changed files with 196 additions and 191 deletions

34
test/database_test.js Normal file
View file

@ -0,0 +1,34 @@
'use strict';
describe('Database', function() {
describe('handleDOMException', function() {
it('handles null, still calls reject', function() {
var called = 0;
var reject = function() {
called += 1;
};
var error = null;
var prefix = 'something';
Whisper.Database.handleDOMException(prefix, error, reject);
assert.strictEqual(called, 1);
});
it('handles object code and message', function() {
var called = 0;
var reject = function() {
called += 1;
};
var error = {
code: 4,
message: 'some cryptic error',
};
var prefix = 'something';
Whisper.Database.handleDOMException(prefix, error, reject);
assert.strictEqual(called, 1);
});
});
});