File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
import 'whatwg-fetch' ; // fetch polyfill needed backendSrv
2
2
import { DataSourceInstanceSettings , TimeRange , toUtc } from '@grafana/data' ;
3
- import { FetchResponse } from '@grafana/runtime' ;
4
- import { backendSrv } from 'app/core/services/backend_srv' ; // will use the version in __mocks__
5
- import { TemplateSrv } from 'app/features/templating/template_srv' ;
3
+ import { FetchResponse , getBackendSrv , TemplateSrv } from '@grafana/runtime' ;
6
4
import { of } from 'rxjs' ;
7
5
8
6
import { PrometheusDatasource } from './datasource' ;
9
7
import PrometheusMetricFindQuery from './metric_find_query' ;
10
8
import { PromApplication , PromOptions } from './types' ;
11
9
10
+ // This should be mocked like here https://github.com/grafana/grafana/blob/main/public/app/plugins/datasource/influxdb/mocks.ts
11
+ const backendSrv = getBackendSrv ( ) ;
12
+
12
13
jest . mock ( '@grafana/runtime' , ( ) => ( {
13
14
...jest . requireActual ( '@grafana/runtime' ) ,
14
15
getBackendSrv : ( ) => backendSrv ,
You can’t perform that action at this time.
0 commit comments