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

34 lines
788 B
JavaScript
Raw Normal View History

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