Start working on /account/data controller
This commit is contained in:
parent
33b2bc2d30
commit
8b1b501bbd
9 changed files with 186 additions and 6 deletions
|
|
@ -1,6 +1,7 @@
|
|||
const assert = require('assert');
|
||||
const AccountDB = require('../../lib/db/account').AccountDB;
|
||||
const testDB = require('../testutil/db').testDB;
|
||||
const { InvalidRequestError } = require('../../lib/errors');
|
||||
|
||||
const accountDB = new AccountDB(testDB);
|
||||
|
||||
|
|
@ -142,6 +143,10 @@ describe('AccountDB', () => {
|
|||
).then(() => {
|
||||
throw new Error('Expected failure due to missing user');
|
||||
}).catch(error => {
|
||||
assert(
|
||||
error instanceof InvalidRequestError,
|
||||
'Expected InvalidRequestError'
|
||||
);
|
||||
assert.strictEqual(
|
||||
error.message,
|
||||
'Cannot update: name "test" does not exist'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
const assert = require('assert');
|
||||
const ChannelDB = require('../../lib/db/channel').ChannelDB;
|
||||
const testDB = require('../testutil/db').testDB;
|
||||
const { InvalidRequestError } = require('../../lib/errors');
|
||||
|
||||
const channelDB = new ChannelDB(testDB);
|
||||
|
||||
|
|
@ -130,6 +131,10 @@ describe('ChannelDB', () => {
|
|||
}).then(() => {
|
||||
throw new Error('Expected error due to already existing channel');
|
||||
}).catch(error => {
|
||||
assert(
|
||||
error instanceof InvalidRequestError,
|
||||
'Expected InvalidRequestError'
|
||||
);
|
||||
assert.strictEqual(
|
||||
error.message,
|
||||
'Channel "i_test" is already registered.'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue