diff --git a/.betterer.results b/.betterer.results index 97b205e4c05..110f516c83c 100644 --- a/.betterer.results +++ b/.betterer.results @@ -107,7 +107,7 @@ exports[`no enzyme tests`] = { "public/app/core/components/QueryOperationRow/QueryOperationRow.test.tsx:3743889097": [ [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"] ], "public/app/features/alerting/AlertRuleList.test.tsx:2998938420": [ diff --git a/e2e/panels-suite/panelEdit_queries.spec.ts b/e2e/panels-suite/panelEdit_queries.spec.ts index c6c46223064..e8505eaca80 100644 --- a/e2e/panels-suite/panelEdit_queries.spec.ts +++ b/e2e/panels-suite/panelEdit_queries.spec.ts @@ -1,7 +1,5 @@ import { e2e } from '@grafana/e2e'; -import { expect } from '../../public/test/lib/common'; - const flakyTimeout = 10000; e2e.scenario({ diff --git a/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.test.tsx b/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.test.tsx index 4d7a66badd2..70828c81a6e 100644 --- a/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.test.tsx +++ b/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.test.tsx @@ -1,8 +1,6 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; -import { expect } from '../../../../../public/test/lib/common'; - import { CallToActionCard } from './CallToActionCard'; describe('CallToActionCard', () => { diff --git a/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.test.tsx b/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.test.tsx index 6a91f927413..223ec38b780 100644 --- a/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.test.tsx +++ b/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.test.tsx @@ -2,8 +2,6 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; -import { expect } from '../../../../../public/test/lib/common'; - import { ConfirmButton } from './ConfirmButton'; describe('ConfirmButton', () => { diff --git a/public/app/core/components/Select/MetricSelect.test.tsx b/public/app/core/components/Select/MetricSelect.test.tsx index 7dc5066a78b..465f406b6a6 100644 --- a/public/app/core/components/Select/MetricSelect.test.tsx +++ b/public/app/core/components/Select/MetricSelect.test.tsx @@ -3,8 +3,6 @@ import React from 'react'; import { LegacyForms } from '@grafana/ui'; -import { expect } from '../../../../test/lib/common'; - import { MetricSelect } from './MetricSelect'; const { Select } = LegacyForms; diff --git a/public/app/core/history/RichHistoryLocalStorage.test.ts b/public/app/core/history/RichHistoryLocalStorage.test.ts index 0f4090a35f1..8a229df2131 100644 --- a/public/app/core/history/RichHistoryLocalStorage.test.ts +++ b/public/app/core/history/RichHistoryLocalStorage.test.ts @@ -1,7 +1,6 @@ import { DataQuery } from '@grafana/data'; import store from 'app/core/store'; -import { afterEach, beforeEach } from '../../../test/lib/common'; import { DatasourceSrv } from '../../features/plugins/datasource_srv'; import { RichHistoryQuery } from '../../types'; import { backendSrv } from '../services/backend_srv'; diff --git a/public/app/core/reducers/root.test.ts b/public/app/core/reducers/root.test.ts index 13b685c79f7..a4a4d63dae1 100644 --- a/public/app/core/reducers/root.test.ts +++ b/public/app/core/reducers/root.test.ts @@ -1,5 +1,4 @@ import { reducerTester } from '../../../test/core/redux/reducerTester'; -import { describe, expect } from '../../../test/lib/common'; import { initialTeamsState, teamsLoaded } from '../../features/teams/state/reducers'; import { Team } from '../../types'; import { StoreState } from '../../types/store'; diff --git a/public/app/core/services/FetchQueueWorker.test.ts b/public/app/core/services/FetchQueueWorker.test.ts index 6f1d5dedb7b..c261cce698a 100644 --- a/public/app/core/services/FetchQueueWorker.test.ts +++ b/public/app/core/services/FetchQueueWorker.test.ts @@ -2,8 +2,6 @@ import { Subject } from 'rxjs'; import { GrafanaBootConfig } from '@grafana/runtime'; -import { expect } from '../../../test/lib/common'; - import { FetchQueue, FetchQueueUpdate, FetchStatus } from './FetchQueue'; import { FetchQueueWorker } from './FetchQueueWorker'; import { ResponseQueue } from './ResponseQueue'; diff --git a/public/app/core/services/ResponseQueue.test.ts b/public/app/core/services/ResponseQueue.test.ts index 5c8c19c4675..bfd254ab8c0 100644 --- a/public/app/core/services/ResponseQueue.test.ts +++ b/public/app/core/services/ResponseQueue.test.ts @@ -3,8 +3,6 @@ import { first } from 'rxjs/operators'; import { BackendSrvRequest } from '@grafana/runtime'; -import { describe, expect } from '../../../test/lib/common'; - import { FetchQueue, FetchQueueUpdate } from './FetchQueue'; import { subscribeTester } from './FetchQueue.test'; import { ResponseQueue } from './ResponseQueue'; diff --git a/public/app/core/specs/search_srv.test.ts b/public/app/core/specs/search_srv.test.ts index 5fe30ef2df1..28fff1478df 100644 --- a/public/app/core/specs/search_srv.test.ts +++ b/public/app/core/specs/search_srv.test.ts @@ -1,5 +1,3 @@ -import { beforeEach } from 'test/lib/common'; - import { contextSrv } from 'app/core/services/context_srv'; import impressionSrv from 'app/core/services/impression_srv'; import { SearchSrv } from 'app/core/services/search_srv'; diff --git a/public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.test.tsx b/public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.test.tsx index 8586b726640..84fe77ebe90 100644 --- a/public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.test.tsx +++ b/public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.test.tsx @@ -1,4 +1,3 @@ -import { describe, expect } from '../../../../../test/lib/common'; import { DashboardSearchHit, DashboardSearchItemType } from '../../../search/types'; import { DashboardLink } from '../../state/DashboardModel'; diff --git a/public/app/features/dashboard/services/TimeSrv.test.ts b/public/app/features/dashboard/services/TimeSrv.test.ts index 26124b7b299..c508b100c60 100644 --- a/public/app/features/dashboard/services/TimeSrv.test.ts +++ b/public/app/features/dashboard/services/TimeSrv.test.ts @@ -4,8 +4,6 @@ import { ContextSrvStub } from 'test/specs/helpers'; import { dateTime, isDateTime } from '@grafana/data'; import { HistoryWrapper, locationService, setLocationService } from '@grafana/runtime'; -import { beforeEach } from '../../../../test/lib/common'; - import { TimeSrv } from './TimeSrv'; jest.mock('app/core/core', () => ({ diff --git a/public/app/features/dashboard/state/DashboardMigrator.test.ts b/public/app/features/dashboard/state/DashboardMigrator.test.ts index a2269ab56df..93fe3e3c98b 100644 --- a/public/app/features/dashboard/state/DashboardMigrator.test.ts +++ b/public/app/features/dashboard/state/DashboardMigrator.test.ts @@ -1,5 +1,4 @@ import { each, map } from 'lodash'; -import { expect } from 'test/lib/common'; import { DataLinkBuiltInVars, MappingType } from '@grafana/data'; import { setDataSourceSrv } from '@grafana/runtime'; diff --git a/public/app/features/dashboard/state/DashboardModel.refresh.test.ts b/public/app/features/dashboard/state/DashboardModel.refresh.test.ts index 8eed7928506..67d7555f9d2 100644 --- a/public/app/features/dashboard/state/DashboardModel.refresh.test.ts +++ b/public/app/features/dashboard/state/DashboardModel.refresh.test.ts @@ -1,4 +1,3 @@ -import { afterEach, beforeEach } from '../../../../test/lib/common'; import { appEvents } from '../../../core/core'; import { VariablesChanged } from '../../variables/types'; import { getTimeSrv, setTimeSrv } from '../services/TimeSrv'; diff --git a/public/app/features/dashboard/state/DashboardModel.repeat.test.ts b/public/app/features/dashboard/state/DashboardModel.repeat.test.ts index b333eb878a4..e95bc66d36d 100644 --- a/public/app/features/dashboard/state/DashboardModel.repeat.test.ts +++ b/public/app/features/dashboard/state/DashboardModel.repeat.test.ts @@ -1,5 +1,4 @@ import { compact, flattenDeep, map, uniq } from 'lodash'; -import { expect } from 'test/lib/common'; import { DashboardPanelsChangedEvent } from 'app/types/events'; diff --git a/public/app/features/dashboard/state/DashboardModel.test.ts b/public/app/features/dashboard/state/DashboardModel.test.ts index b14fc23d754..48ba907b1da 100644 --- a/public/app/features/dashboard/state/DashboardModel.test.ts +++ b/public/app/features/dashboard/state/DashboardModel.test.ts @@ -1,7 +1,6 @@ import { keys as _keys } from 'lodash'; import { getDashboardModel } from '../../../../test/helpers/getDashboardModel'; -import { expect } from '../../../../test/lib/common'; import { variableAdapters } from '../../variables/adapters'; import { createAdHocVariableAdapter } from '../../variables/adhoc/adapter'; import { createCustomVariableAdapter } from '../../variables/custom/adapter'; diff --git a/public/app/features/dashboard/utils/getPanelMenu.test.ts b/public/app/features/dashboard/utils/getPanelMenu.test.ts index 6ca07eb7998..ab6751711f7 100644 --- a/public/app/features/dashboard/utils/getPanelMenu.test.ts +++ b/public/app/features/dashboard/utils/getPanelMenu.test.ts @@ -3,7 +3,6 @@ import config from 'app/core/config'; import * as actions from 'app/features/explore/state/main'; import { setStore } from 'app/store/store'; -import { describe } from '../../../../test/lib/common'; import { DashboardModel, PanelModel } from '../state'; import { getPanelMenu } from './getPanelMenu'; diff --git a/public/app/features/variables/interval/actions.test.ts b/public/app/features/variables/interval/actions.test.ts index 6a8b4020b79..a16d23b570a 100644 --- a/public/app/features/variables/interval/actions.test.ts +++ b/public/app/features/variables/interval/actions.test.ts @@ -2,7 +2,6 @@ import { dateTime } from '@grafana/data'; import { reduxTester } from '../../../../test/core/redux/reduxTester'; import { silenceConsoleOutput } from '../../../../test/core/utils/silenceConsoleOutput'; -import { afterEach, beforeEach } from '../../../../test/lib/common'; import { notifyApp } from '../../../core/actions'; import { getTimeSrv, setTimeSrv, TimeSrv } from '../../dashboard/services/TimeSrv'; import { TemplateSrv } from '../../templating/template_srv'; diff --git a/public/app/features/variables/query/QueryVariableEditor.test.tsx b/public/app/features/variables/query/QueryVariableEditor.test.tsx index 23754e21007..21bd94127ad 100644 --- a/public/app/features/variables/query/QueryVariableEditor.test.tsx +++ b/public/app/features/variables/query/QueryVariableEditor.test.tsx @@ -6,7 +6,6 @@ import { DataSourceApi } from '@grafana/data'; import { mockDataSource } from 'app/features/alerting/unified/mocks'; import { DataSourceType } from 'app/features/alerting/unified/utils/datasource'; -import { describe, expect } from '../../../../test/lib/common'; import { NEW_VARIABLE_ID } from '../constants'; import { LegacyVariableQueryEditor } from '../editor/LegacyVariableQueryEditor'; import { KeyedVariableIdentifier } from '../state/types'; diff --git a/public/app/features/variables/query/actions.test.tsx b/public/app/features/variables/query/actions.test.tsx index 50ed066034c..a7f2d2a07e2 100644 --- a/public/app/features/variables/query/actions.test.tsx +++ b/public/app/features/variables/query/actions.test.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import { expect } from 'test/lib/common'; import { DataSourceRef, getDefaultTimeRange, LoadingState } from '@grafana/data'; import { setDataSourceSrv } from '@grafana/runtime'; diff --git a/public/app/features/variables/state/onTimeRangeUpdated.test.ts b/public/app/features/variables/state/onTimeRangeUpdated.test.ts index 774467c69b0..417c33f6c7f 100644 --- a/public/app/features/variables/state/onTimeRangeUpdated.test.ts +++ b/public/app/features/variables/state/onTimeRangeUpdated.test.ts @@ -2,7 +2,6 @@ import { dateTime, TimeRange } from '@grafana/data'; import { reduxTester } from '../../../../test/core/redux/reduxTester'; import { silenceConsoleOutput } from '../../../../test/core/utils/silenceConsoleOutput'; -import { expect } from '../../../../test/lib/common'; import { appEvents } from '../../../core/core'; import { notifyApp } from '../../../core/reducers/appNotification'; import { DashboardState } from '../../../types'; diff --git a/public/app/plugins/datasource/prometheus/datasource.test.ts b/public/app/plugins/datasource/prometheus/datasource.test.ts index d5705107cee..a80f1f4279d 100644 --- a/public/app/plugins/datasource/prometheus/datasource.test.ts +++ b/public/app/plugins/datasource/prometheus/datasource.test.ts @@ -14,7 +14,6 @@ import { } from '@grafana/data'; import { QueryOptions } from 'app/types'; -import { describe } from '../../../../test/lib/common'; import { VariableHide } from '../../../features/variables/types'; import { diff --git a/public/app/plugins/panel/heatmap/specs/heatmap_data_converter.test.ts b/public/app/plugins/panel/heatmap/specs/heatmap_data_converter.test.ts index 7fbcef1b816..816a679d2b0 100644 --- a/public/app/plugins/panel/heatmap/specs/heatmap_data_converter.test.ts +++ b/public/app/plugins/panel/heatmap/specs/heatmap_data_converter.test.ts @@ -2,7 +2,6 @@ import { cloneDeep, each, map } from 'lodash'; import TimeSeries from 'app/core/time_series2'; -import { describe, beforeEach, it, expect } from '../../../../../test/lib/common'; import { convertToHeatMap, convertToCards, diff --git a/public/test/lib/common.ts b/public/test/lib/common.ts index 44463dbeeef..7a9a08803ba 100644 --- a/public/test/lib/common.ts +++ b/public/test/lib/common.ts @@ -1,15 +1,9 @@ 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 expect = _global.expect; const angularMocks = { module: _global.module, inject: _global.inject, }; -export { beforeEach, afterEach, before, describe, it, sinon, expect, angularMocks }; +export { sinon, angularMocks };