1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/test/unit/routes/strategies.test.js
ivaosthu b8014fdddf Server Metrics with Prometheus
Implementation use internal eventBus to enable loose counting in the app.

read more at https://prometheus.io/

Closes #98
2020-02-20 08:30:40 +01:00

34 lines
788 B
JavaScript

'use strict';
const test = require('ava');
const store = require('./fixtures/store');
const supertest = require('supertest');
const logger = require('../../../lib/logger');
const getApp = require('../../../lib/app');
const { EventEmitter } = require('events');
const eventBus = new EventEmitter();
test.beforeEach(() => {
logger.setLevel('FATAL');
});
test('should add version numbers for /stategies', t => {
const stores = store.createStores();
const app = getApp({
baseUriPath: '',
stores,
eventBus,
});
const request = supertest(app);
return request
.get('/api/strategies')
.expect('Content-Type', /json/)
.expect(200)
.expect((res) => {
t.true(res.body.version === 1);
});
});