1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/test/e2e/stores/setting-store.e2e.test.js
Ivar Conradi Østhus b912768923
feat: move secrets to settings (#577)
* 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
2020-04-13 22:38:46 +02:00

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);
});