chore/cli: Replace msw with setupRequestMockHandlers
Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { msw } from '@backstage/test-utils';
|
||||
import { setupRequestMockHandlers } from '@backstage/test-utils';
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
import { BitriseClientApi } from './bitriseApi.client';
|
||||
@@ -24,7 +24,7 @@ import { UrlPatternDiscovery } from '@backstage/core-app-api';
|
||||
const server = setupServer();
|
||||
|
||||
describe('BitriseClientApi', () => {
|
||||
msw.setupDefaultHandlers(server);
|
||||
setupRequestMockHandlers(server);
|
||||
|
||||
const mockBaseUrl = 'http://backstage:9191/api/proxy';
|
||||
const discoveryApi = UrlPatternDiscovery.compile(mockBaseUrl);
|
||||
|
||||
+5
-2
@@ -18,7 +18,10 @@ import React from 'react';
|
||||
import { bitriseApiRef } from '../../plugin';
|
||||
import { BitriseClientApi } from '../../api/bitriseApi.client';
|
||||
import { setupServer } from 'msw/node';
|
||||
import { msw, renderInTestApp } from '@backstage/test-utils';
|
||||
import {
|
||||
setupRequestMockHandlers,
|
||||
renderInTestApp,
|
||||
} from '@backstage/test-utils';
|
||||
import { useBitriseBuilds } from '../../hooks/useBitriseBuilds';
|
||||
import { BitriseBuildsTable } from './BitriseBuildsTableComponent';
|
||||
import {
|
||||
@@ -34,7 +37,7 @@ jest.mock('../../hooks/useBitriseBuilds', () => ({
|
||||
const server = setupServer();
|
||||
|
||||
describe('BitriseBuildsFetchComponent', () => {
|
||||
msw.setupDefaultHandlers(server);
|
||||
setupRequestMockHandlers(server);
|
||||
const mockBaseUrl = 'http://backstage:9191';
|
||||
const discoveryApi = UrlPatternDiscovery.compile(mockBaseUrl);
|
||||
let apis: ApiRegistry;
|
||||
|
||||
Reference in New Issue
Block a user