1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/test/e2e/api/client/metrics.e2e.test.js

29 lines
773 B
JavaScript
Raw Normal View History

'use strict';
2018-12-17 09:24:49 +01:00
const test = require('ava');
2017-12-18 14:21:11 +01:00
const { setupApp } = require('./../../helpers/test-helper');
const metricsExample = require('../../../examples/client-metrics.json');
test.serial('should be possble to send metrics', async t => {
t.plan(0);
const { request, destroy } = await setupApp('metrics_api_client');
return request
.post('/api/client/metrics')
.send(metricsExample)
.expect(202)
.then(destroy);
});
test.serial('should require valid send metrics', async t => {
t.plan(0);
const { request, destroy } = await setupApp('metrics_api_client');
return request
.post('/api/client/metrics')
.send({
appName: 'test',
})
.expect(400)
.then(destroy);
});