Skip to content

Commit

Permalink
make msw quiet in tests (#17809)
Browse files Browse the repository at this point in the history
  • Loading branch information
madsrasmussen authored Dec 13, 2024
1 parent 0b9855c commit a85f82f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/Umbraco.Web.UI.Client/src/mocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { umbracoPath } from '@umbraco-cms/backoffice/utils';

const worker = setupWorker(...handlers);

export { setupWorker };

export const onUnhandledRequest = (req: MockedRequest) => {
if (req.url.pathname.startsWith(umbracoPath(''))) {
console.warn('Found an unhandled %s request to %s', req.method, req.url.href);
Expand Down
2 changes: 1 addition & 1 deletion src/Umbraco.Web.UI.Client/utils/all-umb-consts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export const foundConsts = [{
},
{
path: '@umbraco-cms/backoffice/member',
consts: ["UMB_MEMBER_COLLECTION_ALIAS","UMB_MEMBER_COLLECTION_CONTEXT","UMB_MEMBER_COLLECTION_REPOSITORY_ALIAS","UMB_MEMBER_TABLE_COLLECTION_VIEW_ALIAS","UMB_MEMBER_PICKER_MODAL","UMB_MEMBER_CREATE_OPTIONS_MODAL","UMB_MEMBER_ENTITY_TYPE","UMB_MEMBER_ROOT_ENTITY_TYPE","UMB_MEMBER_WORKSPACE_PATH","UMB_MEMBER_ROOT_WORKSPACE_PATH","UMB_CREATE_MEMBER_WORKSPACE_PATH_PATTERN","UMB_MEMBER_VARIANT_CONTEXT","UMB_MEMBER_DETAIL_REPOSITORY_ALIAS","UMB_MEMBER_DETAIL_STORE_ALIAS","UMB_MEMBER_DETAIL_STORE_CONTEXT","UMB_MEMBER_ITEM_REPOSITORY_ALIAS","UMB_MEMBER_STORE_ALIAS","UMB_MEMBER_ITEM_STORE_CONTEXT","UMB_MEMBER_VALIDATION_REPOSITORY_ALIAS","UMB_MEMBER_SEARCH_PROVIDER_ALIAS","UMB_MEMBER_DETAIL_MODEL_VARIANT_SCAFFOLD","UMB_MEMBER_WORKSPACE_ALIAS","UMB_MEMBER_WORKSPACE_CONTEXT","UMB_MEMBER_ROOT_WORKSPACE_ALIAS"]
consts: ["UMB_MEMBER_COLLECTION_ALIAS","UMB_MEMBER_COLLECTION_CONTEXT","UMB_MEMBER_COLLECTION_REPOSITORY_ALIAS","UMB_MEMBER_TABLE_COLLECTION_VIEW_ALIAS","UMB_MEMBER_PICKER_MODAL","UMB_MEMBER_CREATE_OPTIONS_MODAL","UMB_MEMBER_ENTITY_TYPE","UMB_MEMBER_ROOT_ENTITY_TYPE","UMB_MEMBER_WORKSPACE_PATH","UMB_MEMBER_ROOT_WORKSPACE_PATH","UMB_CREATE_MEMBER_WORKSPACE_PATH_PATTERN","UMB_MEMBER_VARIANT_CONTEXT","UMB_MEMBER_DETAIL_REPOSITORY_ALIAS","UMB_MEMBER_DETAIL_STORE_ALIAS","UMB_MEMBER_DETAIL_STORE_CONTEXT","UMB_MEMBER_ITEM_REPOSITORY_ALIAS","UMB_MEMBER_STORE_ALIAS","UMB_MEMBER_ITEM_STORE_CONTEXT","UMB_MEMBER_SEARCH_PROVIDER_ALIAS","UMB_MEMBER_DETAIL_MODEL_VARIANT_SCAFFOLD","UMB_MEMBER_WORKSPACE_ALIAS","UMB_MEMBER_WORKSPACE_CONTEXT","UMB_MEMBER_ROOT_WORKSPACE_ALIAS"]
},
{
path: '@umbraco-cms/backoffice/menu',
Expand Down
5 changes: 2 additions & 3 deletions src/Umbraco.Web.UI.Client/web-test-runner.index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { handlers } from './src/mocks/browser-handlers.js';
import { onUnhandledRequest } from './src/mocks/index.js';

const { setupWorker } = window.MockServiceWorker;
import { onUnhandledRequest, setupWorker } from './src/mocks/index.js';

const worker = setupWorker(...handlers);

worker.start({
onUnhandledRequest,
quiet: true,
});

0 comments on commit a85f82f

Please sign in to comment.