1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/test/unit/routes/fixtures/fake-feature-toggle-store.js

19 lines
462 B
JavaScript

'use strict';
module.exports = () => {
const _features = [];
return {
getFeature: (name) => {
const toggle = _features.find(f => f.name === name);
if (toggle) {
return Promise.resolve(toggle);
} else {
return Promise.reject();
}
},
getFeatures: () => Promise.resolve(_features),
addFeature: (feature) => _features.push(feature),
};
};