grafana/public/test/helpers/createFetchResponse.ts
2020-11-26 10:32:02 +01:00

16 lines
393 B
TypeScript

import { FetchResponse } from '@grafana/runtime';
export function createFetchResponse<T>(data: T): FetchResponse<T> {
return {
data,
status: 200,
url: 'http://localhost:3000/api/tsdb/query',
config: { url: 'http://localhost:3000/api/tsdb/query' },
type: 'basic',
statusText: 'Ok',
redirected: false,
headers: ({} as unknown) as Headers,
ok: true,
};
}