chore/cli: Replace msw with setupRequestMockHandlers

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2021-10-26 10:38:13 +02:00
parent 2ba4a2caef
commit f1e96dc5b1
29 changed files with 74 additions and 57 deletions
@@ -20,7 +20,7 @@ import {
} from '@backstage/backend-common';
import { Entity } from '@backstage/catalog-model';
import { DefaultTechDocsCollator } from './DefaultTechDocsCollator';
import { msw } from '@backstage/test-utils';
import { setupRequestMockHandlers } from '@backstage/test-utils';
import { setupServer } from 'msw/node';
import { rest } from 'msw';
import { ConfigReader } from '@backstage/config';
@@ -90,7 +90,7 @@ describe('DefaultTechDocsCollator with legacyPathCasing configuration', () => {
let collator: DefaultTechDocsCollator;
const worker = setupServer();
msw.setupDefaultHandlers(worker);
setupRequestMockHandlers(worker);
beforeEach(() => {
mockDiscoveryApi = {
getBaseUrl: jest.fn().mockResolvedValue('http://test-backend'),
@@ -148,7 +148,7 @@ describe('DefaultTechDocsCollator', () => {
let collator: DefaultTechDocsCollator;
const worker = setupServer();
msw.setupDefaultHandlers(worker);
setupRequestMockHandlers(worker);
beforeEach(() => {
mockDiscoveryApi = {
getBaseUrl: jest.fn().mockResolvedValue('http://test-backend'),