mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +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 => {
|
test('should return applications', t => {
|
||||||
t.plan(2);
|
t.plan(2);
|
||||||
const { request, stores } = getSetup();
|
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';
|
'use strict';
|
||||||
|
|
||||||
const _appliations = [];
|
module.exports = () => {
|
||||||
|
const apps = [];
|
||||||
|
|
||||||
module.exports = () => ({
|
return {
|
||||||
upsert: app => {
|
upsert: app => {
|
||||||
_appliations.push(app);
|
apps.push(app);
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
},
|
},
|
||||||
getApplications: () => Promise.resolve(_appliations),
|
getApplications: () => Promise.resolve(apps),
|
||||||
getApplication: appName => _appliations.filter(a => a.name === appName)[0],
|
getApplication: appName => apps.filter(a => a.name === appName)[0],
|
||||||
});
|
};
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user