mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
remove exported test globals from test/lib/common (#50256)
This commit is contained in:
parent
22fbcebabf
commit
6fcb2cd307
@ -107,7 +107,7 @@ exports[`no enzyme tests`] = {
|
|||||||
"public/app/core/components/QueryOperationRow/QueryOperationRow.test.tsx:3743889097": [
|
"public/app/core/components/QueryOperationRow/QueryOperationRow.test.tsx:3743889097": [
|
||||||
[0, 26, 13, "RegExp match", "2409514259"]
|
[0, 26, 13, "RegExp match", "2409514259"]
|
||||||
],
|
],
|
||||||
"public/app/core/components/Select/MetricSelect.test.tsx:3351544014": [
|
"public/app/core/components/Select/MetricSelect.test.tsx:1074737147": [
|
||||||
[0, 19, 13, "RegExp match", "2409514259"]
|
[0, 19, 13, "RegExp match", "2409514259"]
|
||||||
],
|
],
|
||||||
"public/app/features/alerting/AlertRuleList.test.tsx:2998938420": [
|
"public/app/features/alerting/AlertRuleList.test.tsx:2998938420": [
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import { e2e } from '@grafana/e2e';
|
import { e2e } from '@grafana/e2e';
|
||||||
|
|
||||||
import { expect } from '../../public/test/lib/common';
|
|
||||||
|
|
||||||
const flakyTimeout = 10000;
|
const flakyTimeout = 10000;
|
||||||
|
|
||||||
e2e.scenario({
|
e2e.scenario({
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import { render, screen } from '@testing-library/react';
|
import { render, screen } from '@testing-library/react';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { expect } from '../../../../../public/test/lib/common';
|
|
||||||
|
|
||||||
import { CallToActionCard } from './CallToActionCard';
|
import { CallToActionCard } from './CallToActionCard';
|
||||||
|
|
||||||
describe('CallToActionCard', () => {
|
describe('CallToActionCard', () => {
|
||||||
|
@ -2,8 +2,6 @@ import { render, screen } from '@testing-library/react';
|
|||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { expect } from '../../../../../public/test/lib/common';
|
|
||||||
|
|
||||||
import { ConfirmButton } from './ConfirmButton';
|
import { ConfirmButton } from './ConfirmButton';
|
||||||
|
|
||||||
describe('ConfirmButton', () => {
|
describe('ConfirmButton', () => {
|
||||||
|
@ -3,8 +3,6 @@ import React from 'react';
|
|||||||
|
|
||||||
import { LegacyForms } from '@grafana/ui';
|
import { LegacyForms } from '@grafana/ui';
|
||||||
|
|
||||||
import { expect } from '../../../../test/lib/common';
|
|
||||||
|
|
||||||
import { MetricSelect } from './MetricSelect';
|
import { MetricSelect } from './MetricSelect';
|
||||||
|
|
||||||
const { Select } = LegacyForms;
|
const { Select } = LegacyForms;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { DataQuery } from '@grafana/data';
|
import { DataQuery } from '@grafana/data';
|
||||||
import store from 'app/core/store';
|
import store from 'app/core/store';
|
||||||
|
|
||||||
import { afterEach, beforeEach } from '../../../test/lib/common';
|
|
||||||
import { DatasourceSrv } from '../../features/plugins/datasource_srv';
|
import { DatasourceSrv } from '../../features/plugins/datasource_srv';
|
||||||
import { RichHistoryQuery } from '../../types';
|
import { RichHistoryQuery } from '../../types';
|
||||||
import { backendSrv } from '../services/backend_srv';
|
import { backendSrv } from '../services/backend_srv';
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { reducerTester } from '../../../test/core/redux/reducerTester';
|
import { reducerTester } from '../../../test/core/redux/reducerTester';
|
||||||
import { describe, expect } from '../../../test/lib/common';
|
|
||||||
import { initialTeamsState, teamsLoaded } from '../../features/teams/state/reducers';
|
import { initialTeamsState, teamsLoaded } from '../../features/teams/state/reducers';
|
||||||
import { Team } from '../../types';
|
import { Team } from '../../types';
|
||||||
import { StoreState } from '../../types/store';
|
import { StoreState } from '../../types/store';
|
||||||
|
@ -2,8 +2,6 @@ import { Subject } from 'rxjs';
|
|||||||
|
|
||||||
import { GrafanaBootConfig } from '@grafana/runtime';
|
import { GrafanaBootConfig } from '@grafana/runtime';
|
||||||
|
|
||||||
import { expect } from '../../../test/lib/common';
|
|
||||||
|
|
||||||
import { FetchQueue, FetchQueueUpdate, FetchStatus } from './FetchQueue';
|
import { FetchQueue, FetchQueueUpdate, FetchStatus } from './FetchQueue';
|
||||||
import { FetchQueueWorker } from './FetchQueueWorker';
|
import { FetchQueueWorker } from './FetchQueueWorker';
|
||||||
import { ResponseQueue } from './ResponseQueue';
|
import { ResponseQueue } from './ResponseQueue';
|
||||||
|
@ -3,8 +3,6 @@ import { first } from 'rxjs/operators';
|
|||||||
|
|
||||||
import { BackendSrvRequest } from '@grafana/runtime';
|
import { BackendSrvRequest } from '@grafana/runtime';
|
||||||
|
|
||||||
import { describe, expect } from '../../../test/lib/common';
|
|
||||||
|
|
||||||
import { FetchQueue, FetchQueueUpdate } from './FetchQueue';
|
import { FetchQueue, FetchQueueUpdate } from './FetchQueue';
|
||||||
import { subscribeTester } from './FetchQueue.test';
|
import { subscribeTester } from './FetchQueue.test';
|
||||||
import { ResponseQueue } from './ResponseQueue';
|
import { ResponseQueue } from './ResponseQueue';
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import { beforeEach } from 'test/lib/common';
|
|
||||||
|
|
||||||
import { contextSrv } from 'app/core/services/context_srv';
|
import { contextSrv } from 'app/core/services/context_srv';
|
||||||
import impressionSrv from 'app/core/services/impression_srv';
|
import impressionSrv from 'app/core/services/impression_srv';
|
||||||
import { SearchSrv } from 'app/core/services/search_srv';
|
import { SearchSrv } from 'app/core/services/search_srv';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { describe, expect } from '../../../../../test/lib/common';
|
|
||||||
import { DashboardSearchHit, DashboardSearchItemType } from '../../../search/types';
|
import { DashboardSearchHit, DashboardSearchItemType } from '../../../search/types';
|
||||||
import { DashboardLink } from '../../state/DashboardModel';
|
import { DashboardLink } from '../../state/DashboardModel';
|
||||||
|
|
||||||
|
@ -4,8 +4,6 @@ import { ContextSrvStub } from 'test/specs/helpers';
|
|||||||
import { dateTime, isDateTime } from '@grafana/data';
|
import { dateTime, isDateTime } from '@grafana/data';
|
||||||
import { HistoryWrapper, locationService, setLocationService } from '@grafana/runtime';
|
import { HistoryWrapper, locationService, setLocationService } from '@grafana/runtime';
|
||||||
|
|
||||||
import { beforeEach } from '../../../../test/lib/common';
|
|
||||||
|
|
||||||
import { TimeSrv } from './TimeSrv';
|
import { TimeSrv } from './TimeSrv';
|
||||||
|
|
||||||
jest.mock('app/core/core', () => ({
|
jest.mock('app/core/core', () => ({
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { each, map } from 'lodash';
|
import { each, map } from 'lodash';
|
||||||
import { expect } from 'test/lib/common';
|
|
||||||
|
|
||||||
import { DataLinkBuiltInVars, MappingType } from '@grafana/data';
|
import { DataLinkBuiltInVars, MappingType } from '@grafana/data';
|
||||||
import { setDataSourceSrv } from '@grafana/runtime';
|
import { setDataSourceSrv } from '@grafana/runtime';
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { afterEach, beforeEach } from '../../../../test/lib/common';
|
|
||||||
import { appEvents } from '../../../core/core';
|
import { appEvents } from '../../../core/core';
|
||||||
import { VariablesChanged } from '../../variables/types';
|
import { VariablesChanged } from '../../variables/types';
|
||||||
import { getTimeSrv, setTimeSrv } from '../services/TimeSrv';
|
import { getTimeSrv, setTimeSrv } from '../services/TimeSrv';
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { compact, flattenDeep, map, uniq } from 'lodash';
|
import { compact, flattenDeep, map, uniq } from 'lodash';
|
||||||
import { expect } from 'test/lib/common';
|
|
||||||
|
|
||||||
import { DashboardPanelsChangedEvent } from 'app/types/events';
|
import { DashboardPanelsChangedEvent } from 'app/types/events';
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { keys as _keys } from 'lodash';
|
import { keys as _keys } from 'lodash';
|
||||||
|
|
||||||
import { getDashboardModel } from '../../../../test/helpers/getDashboardModel';
|
import { getDashboardModel } from '../../../../test/helpers/getDashboardModel';
|
||||||
import { expect } from '../../../../test/lib/common';
|
|
||||||
import { variableAdapters } from '../../variables/adapters';
|
import { variableAdapters } from '../../variables/adapters';
|
||||||
import { createAdHocVariableAdapter } from '../../variables/adhoc/adapter';
|
import { createAdHocVariableAdapter } from '../../variables/adhoc/adapter';
|
||||||
import { createCustomVariableAdapter } from '../../variables/custom/adapter';
|
import { createCustomVariableAdapter } from '../../variables/custom/adapter';
|
||||||
|
@ -3,7 +3,6 @@ import config from 'app/core/config';
|
|||||||
import * as actions from 'app/features/explore/state/main';
|
import * as actions from 'app/features/explore/state/main';
|
||||||
import { setStore } from 'app/store/store';
|
import { setStore } from 'app/store/store';
|
||||||
|
|
||||||
import { describe } from '../../../../test/lib/common';
|
|
||||||
import { DashboardModel, PanelModel } from '../state';
|
import { DashboardModel, PanelModel } from '../state';
|
||||||
|
|
||||||
import { getPanelMenu } from './getPanelMenu';
|
import { getPanelMenu } from './getPanelMenu';
|
||||||
|
@ -2,7 +2,6 @@ import { dateTime } from '@grafana/data';
|
|||||||
|
|
||||||
import { reduxTester } from '../../../../test/core/redux/reduxTester';
|
import { reduxTester } from '../../../../test/core/redux/reduxTester';
|
||||||
import { silenceConsoleOutput } from '../../../../test/core/utils/silenceConsoleOutput';
|
import { silenceConsoleOutput } from '../../../../test/core/utils/silenceConsoleOutput';
|
||||||
import { afterEach, beforeEach } from '../../../../test/lib/common';
|
|
||||||
import { notifyApp } from '../../../core/actions';
|
import { notifyApp } from '../../../core/actions';
|
||||||
import { getTimeSrv, setTimeSrv, TimeSrv } from '../../dashboard/services/TimeSrv';
|
import { getTimeSrv, setTimeSrv, TimeSrv } from '../../dashboard/services/TimeSrv';
|
||||||
import { TemplateSrv } from '../../templating/template_srv';
|
import { TemplateSrv } from '../../templating/template_srv';
|
||||||
|
@ -6,7 +6,6 @@ import { DataSourceApi } from '@grafana/data';
|
|||||||
import { mockDataSource } from 'app/features/alerting/unified/mocks';
|
import { mockDataSource } from 'app/features/alerting/unified/mocks';
|
||||||
import { DataSourceType } from 'app/features/alerting/unified/utils/datasource';
|
import { DataSourceType } from 'app/features/alerting/unified/utils/datasource';
|
||||||
|
|
||||||
import { describe, expect } from '../../../../test/lib/common';
|
|
||||||
import { NEW_VARIABLE_ID } from '../constants';
|
import { NEW_VARIABLE_ID } from '../constants';
|
||||||
import { LegacyVariableQueryEditor } from '../editor/LegacyVariableQueryEditor';
|
import { LegacyVariableQueryEditor } from '../editor/LegacyVariableQueryEditor';
|
||||||
import { KeyedVariableIdentifier } from '../state/types';
|
import { KeyedVariableIdentifier } from '../state/types';
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { expect } from 'test/lib/common';
|
|
||||||
|
|
||||||
import { DataSourceRef, getDefaultTimeRange, LoadingState } from '@grafana/data';
|
import { DataSourceRef, getDefaultTimeRange, LoadingState } from '@grafana/data';
|
||||||
import { setDataSourceSrv } from '@grafana/runtime';
|
import { setDataSourceSrv } from '@grafana/runtime';
|
||||||
|
@ -2,7 +2,6 @@ import { dateTime, TimeRange } from '@grafana/data';
|
|||||||
|
|
||||||
import { reduxTester } from '../../../../test/core/redux/reduxTester';
|
import { reduxTester } from '../../../../test/core/redux/reduxTester';
|
||||||
import { silenceConsoleOutput } from '../../../../test/core/utils/silenceConsoleOutput';
|
import { silenceConsoleOutput } from '../../../../test/core/utils/silenceConsoleOutput';
|
||||||
import { expect } from '../../../../test/lib/common';
|
|
||||||
import { appEvents } from '../../../core/core';
|
import { appEvents } from '../../../core/core';
|
||||||
import { notifyApp } from '../../../core/reducers/appNotification';
|
import { notifyApp } from '../../../core/reducers/appNotification';
|
||||||
import { DashboardState } from '../../../types';
|
import { DashboardState } from '../../../types';
|
||||||
|
@ -14,7 +14,6 @@ import {
|
|||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import { QueryOptions } from 'app/types';
|
import { QueryOptions } from 'app/types';
|
||||||
|
|
||||||
import { describe } from '../../../../test/lib/common';
|
|
||||||
import { VariableHide } from '../../../features/variables/types';
|
import { VariableHide } from '../../../features/variables/types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -2,7 +2,6 @@ import { cloneDeep, each, map } from 'lodash';
|
|||||||
|
|
||||||
import TimeSeries from 'app/core/time_series2';
|
import TimeSeries from 'app/core/time_series2';
|
||||||
|
|
||||||
import { describe, beforeEach, it, expect } from '../../../../../test/lib/common';
|
|
||||||
import {
|
import {
|
||||||
convertToHeatMap,
|
convertToHeatMap,
|
||||||
convertToCards,
|
convertToCards,
|
||||||
|
@ -1,15 +1,9 @@
|
|||||||
const _global = window as any;
|
const _global = window as any;
|
||||||
const beforeEach = _global.beforeEach;
|
|
||||||
const afterEach = _global.afterEach;
|
|
||||||
const before = _global.before;
|
|
||||||
const describe = _global.describe;
|
|
||||||
const it = _global.it;
|
|
||||||
const sinon = _global.sinon;
|
const sinon = _global.sinon;
|
||||||
const expect = _global.expect;
|
|
||||||
|
|
||||||
const angularMocks = {
|
const angularMocks = {
|
||||||
module: _global.module,
|
module: _global.module,
|
||||||
inject: _global.inject,
|
inject: _global.inject,
|
||||||
};
|
};
|
||||||
|
|
||||||
export { beforeEach, afterEach, before, describe, it, sinon, expect, angularMocks };
|
export { sinon, angularMocks };
|
||||||
|
Loading…
Reference in New Issue
Block a user