Remove explicit imports of whatwg-fetch from individual test files

This commit is contained in:
Tom Ratcliffe 2024-04-04 11:56:56 +01:00 committed by Tom Ratcliffe
parent 389250afe0
commit a5c75c5ffb
46 changed files with 0 additions and 52 deletions

View File

@ -1,7 +1,6 @@
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/metric_find_query.test.ts
import { Observable, of } from 'rxjs';
import 'whatwg-fetch'; // fetch polyfill needed backendSrv
import { DataSourceInstanceSettings, TimeRange, toUtc } from '@grafana/data';
import { BackendDataSourceResponse, BackendSrvRequest, FetchResponse, TemplateSrv } from '@grafana/runtime';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch'; // fetch polyfill
import { fireEvent, render as rtlRender, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { HttpResponse, http } from 'msw';

View File

@ -1,5 +1,3 @@
import 'whatwg-fetch'; // fetch polyfill needed for Headers
import { of } from 'rxjs';
import { BackendSrvRequest, FetchResponse } from '@grafana/runtime';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch'; // fetch polyfill needed for PhantomJs rendering
import { Observable, of, lastValueFrom } from 'rxjs';
import { fromFetch } from 'rxjs/fetch';
import { delay } from 'rxjs/operators';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch'; // fetch polyfill needed for PhantomJs rendering
import {
isContentTypeApplicationJson,
parseBody,

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { render, waitFor, waitForElementToBeRemoved, within } from '@testing-library/react';
import { setupServer } from 'msw/node';
import React from 'react';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { screen, waitFor, waitForElementToBeRemoved, within } from '@testing-library/react';
import userEvent, { PointerEventsCheckLevel } from '@testing-library/user-event';
import React from 'react';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { screen, waitFor, waitForElementToBeRemoved, within } from '@testing-library/react';
import userEvent, { PointerEventsCheckLevel } from '@testing-library/user-event';
import React from 'react';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { render, screen, waitFor } from '@testing-library/react';
import { setupServer } from 'msw/node';
import React from 'react';

View File

@ -1,5 +1,3 @@
// bit of setup to mock HTTP request responses
import 'whatwg-fetch';
import { http, HttpResponse } from 'msw';
import { setupServer } from 'msw/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { http, HttpResponse } from 'msw';
import { SetupServer } from 'msw/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { http, HttpResponse } from 'msw';
import { SetupServer } from 'msw/lib/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { http, HttpResponse } from 'msw';
import { SetupServer } from 'msw/lib/node';

View File

@ -6,8 +6,6 @@ import { TestProvider } from 'test/helpers/TestProvider';
import { PayloadEditor, RESET_TO_DEFAULT } from './PayloadEditor';
import 'whatwg-fetch';
const DEFAULT_PAYLOAD = `[
{
"annotations": {

View File

@ -10,7 +10,6 @@ import { setBackendSrv } from '@grafana/runtime';
import { backendSrv } from 'app/core/services/backend_srv';
import { configureStore } from 'app/store/configureStore';
import 'whatwg-fetch';
import { TemplatePreviewResponse } from '../../api/templateApi';
import {
mockPreviewTemplateResponse,

View File

@ -17,8 +17,6 @@ import { RuleFormValues } from '../../types/rule-form';
import { Annotation } from '../../utils/constants';
import { getDefaultFormValues } from '../../utils/rule-form';
import 'whatwg-fetch';
import AnnotationsStep from './AnnotationsStep';
// To get anything displayed inside the Autosize component we need to mock it

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { render, screen, waitFor, waitForElementToBeRemoved } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import React from 'react';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { http, HttpResponse } from 'msw';
import { SetupServer, setupServer } from 'msw/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { render, screen, waitFor } from '@testing-library/react';
import { http, HttpResponse } from 'msw';
import { setupServer } from 'msw/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import React from 'react';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { render, waitFor } from '@testing-library/react';
import { http, HttpResponse } from 'msw';
import { setupServer } from 'msw/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { renderHook, waitFor } from '@testing-library/react';
import { createBrowserHistory } from 'history';
import React, { PropsWithChildren } from 'react';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { renderHook, waitFor } from '@testing-library/react';
import { http, HttpResponse } from 'msw';
import { SetupServer, setupServer } from 'msw/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { uniqueId } from 'lodash';
import { http, HttpResponse } from 'msw';
import { setupServer, SetupServer } from 'msw/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { http, HttpResponse } from 'msw';
import { SetupServer } from 'msw/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { http, HttpResponse } from 'msw';
import { SetupServer } from 'msw/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { http, HttpResponse } from 'msw';
import { SetupServer } from 'msw/lib/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { http, HttpResponse } from 'msw';
import { SetupServer } from 'msw/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { http, HttpResponse } from 'msw';
import { SetupServer } from 'msw/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { render as rtlRender, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { HttpResponse, http } from 'msw';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { render as rtlRender, screen } from '@testing-library/react';
import { http, HttpResponse } from 'msw';
import { SetupServer, setupServer } from 'msw/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { render as rtlRender, screen } from '@testing-library/react';
import { http, HttpResponse } from 'msw';
import { SetupServer, setupServer } from 'msw/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { act, render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import React from 'react';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { waitFor } from '@testing-library/dom';
import { merge } from 'lodash';
import { http, HttpResponse } from 'msw';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { advanceTo } from 'jest-date-mock';
import { map, of } from 'rxjs';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { http, HttpResponse } from 'msw';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { fireEvent, render, screen, waitFor, waitForElementToBeRemoved } from '@testing-library/react';
import { http, HttpResponse } from 'msw';
import React from 'react';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { render, screen, waitFor } from '@testing-library/react';
import React from 'react';
import { Provider } from 'react-redux';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { act, render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import React, { ReactNode } from 'react';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { render, screen, waitForElementToBeRemoved, within } from '@testing-library/react';
import { http, HttpResponse } from 'msw';
import { setupServer } from 'msw/node';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch'; // fetch polyfill
import { render as rtlRender, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import React from 'react';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch'; // fetch polyfill
import { render as rtlRender, screen } from '@testing-library/react';
import React from 'react';
import { TestProvider } from 'test/helpers/TestProvider';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { History, Location } from 'history';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import React from 'react';

View File

@ -1,4 +1,3 @@
import 'whatwg-fetch';
import { http, HttpResponse } from 'msw';
import { setupServer } from 'msw/node';

View File

@ -1,6 +1,3 @@
// mock fetch for SystemJS
import 'whatwg-fetch';
import { config } from '@grafana/runtime';
jest.mock('./cache', () => ({