mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
b912768923
* feat: move secrets to settings * feat: Add better support for detailed db options. Added db field in options to allow better control of db-options. Especially important to allow special chars in database password which might lead to an invaid url when defined as a database-url. * fix: integrate logger with knex logger * fix: remove secret option from all examples * fix: more options.js unit tests * fix: added settings-store e2e tests
29 lines
751 B
JavaScript
29 lines
751 B
JavaScript
'use strict';
|
|
|
|
const test = require('ava');
|
|
const dbInit = require('../helpers/database-init');
|
|
const getLogger = require('../../fixtures/no-logger');
|
|
|
|
let stores;
|
|
|
|
test.before(async () => {
|
|
const db = await dbInit('setting_store_serial', getLogger);
|
|
stores = db.stores;
|
|
});
|
|
|
|
test.after(async () => {
|
|
await stores.db.destroy();
|
|
});
|
|
|
|
test.serial('should have api secret stored', async t => {
|
|
const secret = await stores.settingStore.get('unleash.secret');
|
|
t.assert(secret);
|
|
});
|
|
|
|
test.serial('should insert arbitarty value', async t => {
|
|
const value = { b: 'hello' };
|
|
await stores.settingStore.insert('unleash.custom', value);
|
|
const ret = await stores.settingStore.get('unleash.custom');
|
|
t.deepEqual(ret, value);
|
|
});
|