gitlab-org--gitlab-foss/spec/frontend/serverless/utils.js
Luke Bennett 97b8853d61
Move karma serverless tests to jest for isolation
These tests cause master failures because of an overflow
in vue-test-utils sync watcher setup.
2019-04-07 12:25:06 +01:00

20 lines
556 B
JavaScript

export const adjustMetricQuery = data => {
const updatedMetric = data.metrics;
const queries = data.metrics.queries.map(query => ({
...query,
result: query.result.map(result => ({
...result,
values: result.values.map(([timestamp, value]) => ({
time: new Date(timestamp * 1000).toISOString(),
value: Number(value),
})),
})),
}));
updatedMetric.queries = queries;
return updatedMetric;
};
// prevent babel-plugin-rewire from generating an invalid default during karma tests
export default () => {};