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:
parent
541ef376d9
commit
fae3488580
@ -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);
|
||||
});
|
||||
});
|
@ -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();
|
||||
|
20
test/fixtures/fake-client-applications-store.js
vendored
20
test/fixtures/fake-client-applications-store.js
vendored
@ -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],
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user