fleet/frontend/test/target_mock.js

23 строки
431 B
JavaScript

import nock from 'nock';
const defaultParams = {
query: '',
selected: {
hosts: [],
labels: [],
},
};
const defaultResponse = {
targets: {
hosts: [],
labels: [],
},
};
export default (params = defaultParams, response = defaultResponse, responseStatus = 200) => {
return nock('http://localhost:8080')
.post('/api/v1/kolide/targets', JSON.stringify(params))
.reply(responseStatus, response);
};