mirror of
https://github.com/grafana/grafana.git
synced 2025-09-21 08:53:02 +08:00
Update dependency prettier to v2.5.1 (#43473)
* Update dependency prettier to v2.5.1 * prettier fixes * chore(toolkit): bump prettier to 2.5.1 * style(eslint): bump grafana config to 2.5.2 in core and toolkit * style(mssql-datasource): fix no-inferrable-types eslint errors Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com> Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
@ -337,7 +337,7 @@ export class PostgresQueryCtrl extends QueryCtrl {
|
||||
for (const variable of this.templateSrv.getVariables()) {
|
||||
let value;
|
||||
value = '$' + variable.name;
|
||||
if (config.templateQuoter && ((variable as unknown) as VariableWithMultiSupport).multi === false) {
|
||||
if (config.templateQuoter && (variable as unknown as VariableWithMultiSupport).multi === false) {
|
||||
value = config.templateQuoter(value);
|
||||
}
|
||||
|
||||
|
@ -18,12 +18,12 @@ import { TimeSrv } from '../../../../features/dashboard/services/TimeSrv';
|
||||
import { PostgresOptions, PostgresQuery } from '../types';
|
||||
|
||||
jest.mock('@grafana/runtime', () => ({
|
||||
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||
...(jest.requireActual('@grafana/runtime') as unknown as object),
|
||||
getBackendSrv: () => backendSrv,
|
||||
}));
|
||||
|
||||
jest.mock('@grafana/runtime/src/services', () => ({
|
||||
...((jest.requireActual('@grafana/runtime/src/services') as unknown) as object),
|
||||
...(jest.requireActual('@grafana/runtime/src/services') as unknown as object),
|
||||
getBackendSrv: () => backendSrv,
|
||||
getDataSourceSrv: () => {
|
||||
return {
|
||||
@ -37,23 +37,23 @@ describe('PostgreSQLDatasource', () => {
|
||||
const setupTestContext = (data: any) => {
|
||||
jest.clearAllMocks();
|
||||
fetchMock.mockImplementation(() => of(createFetchResponse(data)));
|
||||
const instanceSettings = ({
|
||||
const instanceSettings = {
|
||||
jsonData: {
|
||||
defaultProject: 'testproject',
|
||||
},
|
||||
} as unknown) as DataSourceInstanceSettings<PostgresOptions>;
|
||||
} as unknown as DataSourceInstanceSettings<PostgresOptions>;
|
||||
const templateSrv: TemplateSrv = new TemplateSrv();
|
||||
const raw = {
|
||||
from: toUtc('2018-04-25 10:00'),
|
||||
to: toUtc('2018-04-25 11:00'),
|
||||
};
|
||||
const timeSrvMock = ({
|
||||
const timeSrvMock = {
|
||||
timeRange: () => ({
|
||||
from: raw.from,
|
||||
to: raw.to,
|
||||
raw: raw,
|
||||
}),
|
||||
} as unknown) as TimeSrv;
|
||||
} as unknown as TimeSrv;
|
||||
const variable = { ...initialCustomVariableModelState };
|
||||
const ds = new PostgresDatasource(instanceSettings, templateSrv, timeSrvMock);
|
||||
|
||||
@ -262,7 +262,7 @@ describe('PostgreSQLDatasource', () => {
|
||||
|
||||
describe('When performing a query with hidden target', () => {
|
||||
it('should return empty result and backendSrv.fetch should not be called', async () => {
|
||||
const options = ({
|
||||
const options = {
|
||||
range: {
|
||||
from: dateTime(1432288354),
|
||||
to: dateTime(1432288401),
|
||||
@ -277,7 +277,7 @@ describe('PostgreSQLDatasource', () => {
|
||||
hide: true,
|
||||
},
|
||||
],
|
||||
} as unknown) as DataQueryRequest<PostgresQuery>;
|
||||
} as unknown as DataQueryRequest<PostgresQuery>;
|
||||
|
||||
const { ds } = setupTestContext({});
|
||||
|
||||
@ -565,7 +565,7 @@ describe('PostgreSQLDatasource', () => {
|
||||
describe('and value is a number', () => {
|
||||
it('should return an unquoted value', () => {
|
||||
const { ds, variable } = setupTestContext({});
|
||||
expect(ds.interpolateVariable((1000 as unknown) as string, variable)).toEqual(1000);
|
||||
expect(ds.interpolateVariable(1000 as unknown as string, variable)).toEqual(1000);
|
||||
});
|
||||
});
|
||||
|
||||
@ -666,6 +666,6 @@ const createFetchResponse = <T>(data: T): FetchResponse<T> => ({
|
||||
type: 'basic',
|
||||
statusText: 'Ok',
|
||||
redirected: false,
|
||||
headers: ({} as unknown) as Headers,
|
||||
headers: {} as unknown as Headers,
|
||||
ok: true,
|
||||
});
|
||||
|
Reference in New Issue
Block a user