chore/cli: Replace msw with setupRequestMockHandlers
Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import { wrapInTestApp, msw } from '@backstage/test-utils';
|
||||
import { wrapInTestApp, setupRequestMockHandlers } from '@backstage/test-utils';
|
||||
import AuditListTable from './AuditListTable';
|
||||
|
||||
import {
|
||||
@@ -36,7 +36,7 @@ describe('AuditListTable', () => {
|
||||
let apis: ApiRegistry;
|
||||
|
||||
const server = setupServer();
|
||||
msw.setupDefaultHandlers(server);
|
||||
setupRequestMockHandlers(server);
|
||||
|
||||
beforeEach(() => {
|
||||
apis = ApiRegistry.from([
|
||||
|
||||
@@ -23,7 +23,7 @@ jest.mock('react-router-dom', () => {
|
||||
};
|
||||
});
|
||||
|
||||
import { msw, wrapInTestApp } from '@backstage/test-utils';
|
||||
import { setupRequestMockHandlers, wrapInTestApp } from '@backstage/test-utils';
|
||||
import { fireEvent, render } from '@testing-library/react';
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
@@ -44,7 +44,7 @@ describe('AuditList', () => {
|
||||
let apis: ApiRegistry;
|
||||
|
||||
const server = setupServer();
|
||||
msw.setupDefaultHandlers(server);
|
||||
setupRequestMockHandlers(server);
|
||||
|
||||
beforeEach(() => {
|
||||
apis = ApiRegistry.from([
|
||||
|
||||
@@ -26,7 +26,7 @@ jest.mock('react-router-dom', () => {
|
||||
};
|
||||
});
|
||||
|
||||
import { msw, wrapInTestApp } from '@backstage/test-utils';
|
||||
import { setupRequestMockHandlers, wrapInTestApp } from '@backstage/test-utils';
|
||||
import { render } from '@testing-library/react';
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
@@ -46,7 +46,7 @@ describe('AuditView', () => {
|
||||
let id: string;
|
||||
|
||||
const server = setupServer();
|
||||
msw.setupDefaultHandlers(server);
|
||||
setupRequestMockHandlers(server);
|
||||
|
||||
beforeEach(() => {
|
||||
server.use(
|
||||
|
||||
@@ -23,7 +23,7 @@ jest.mock('react-router-dom', () => {
|
||||
};
|
||||
});
|
||||
|
||||
import { msw, wrapInTestApp } from '@backstage/test-utils';
|
||||
import { setupRequestMockHandlers, wrapInTestApp } from '@backstage/test-utils';
|
||||
import { fireEvent, render, waitFor } from '@testing-library/react';
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
@@ -44,7 +44,7 @@ describe('CreateAudit', () => {
|
||||
let apis: ApiRegistry;
|
||||
let errorApi: ErrorApi;
|
||||
const server = setupServer();
|
||||
msw.setupDefaultHandlers(server);
|
||||
setupRequestMockHandlers(server);
|
||||
|
||||
beforeEach(() => {
|
||||
errorApi = { post: jest.fn(), error$: jest.fn() };
|
||||
|
||||
Reference in New Issue
Block a user