1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00

chore(modernize): Remove unused files

This commit is contained in:
ivaosthu 2018-11-29 21:45:26 +01:00 committed by Ivar Conradi Østhus
parent 541ef376d9
commit fae3488580
4 changed files with 23 additions and 43 deletions

View File

@ -1,34 +0,0 @@
'use strict';
const { test } = require('ava');
const store = require('./../../../test/fixtures/store');
const supertest = require('supertest');
const getApp = require('../../app');
const { EventEmitter } = require('events');
const eventBus = new EventEmitter();
function getSetup() {
const stores = store.createStores();
const app = getApp({
baseUriPath: '',
stores,
eventBus,
});
return {
request: supertest(app),
stores,
};
}
test('should return list of client applications', t => {
t.plan(1);
const { request } = getSetup();
return request
.get('/api/admin/metrics/applications')
.expect(200)
.expect(res => {
t.true(res.body.applications.length === 0);
});
});

View File

@ -94,6 +94,18 @@ test('should return metrics for all toggles', t => {
});
});
test('should return empty list of client applications', t => {
t.plan(1);
const { request } = getSetup();
return request
.get('/api/admin/metrics/applications')
.expect(200)
.expect(res => {
t.true(res.body.applications.length === 0);
});
});
test('should return applications', t => {
t.plan(2);
const { request, stores } = getSetup();

View File

@ -1,12 +1,14 @@
'use strict';
const _appliations = [];
module.exports = () => {
const apps = [];
module.exports = () => ({
upsert: app => {
_appliations.push(app);
return Promise.resolve();
},
getApplications: () => Promise.resolve(_appliations),
getApplication: appName => _appliations.filter(a => a.name === appName)[0],
});
return {
upsert: app => {
apps.push(app);
return Promise.resolve();
},
getApplications: () => Promise.resolve(apps),
getApplication: appName => apps.filter(a => a.name === appName)[0],
};
};