mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
29 lines
777 B
JavaScript
29 lines
777 B
JavaScript
'use strict';
|
|
|
|
const { test } = require('ava');
|
|
|
|
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);
|
|
});
|