Merge branch 'master' into use-search-icon
This commit is contained in:
@@ -1,5 +1,58 @@
|
||||
# @backstage/test-utils
|
||||
|
||||
## 1.5.10-next.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/plugin-permission-common@0.8.1-next.1
|
||||
- @backstage/plugin-permission-react@0.4.25-next.1
|
||||
- @backstage/config@1.2.0
|
||||
- @backstage/core-app-api@1.14.2-next.0
|
||||
- @backstage/core-plugin-api@1.9.3
|
||||
- @backstage/theme@0.5.6
|
||||
- @backstage/types@1.1.1
|
||||
|
||||
## 1.5.10-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/plugin-permission-common@0.8.1-next.0
|
||||
- @backstage/plugin-permission-react@0.4.25-next.0
|
||||
- @backstage/config@1.2.0
|
||||
- @backstage/core-app-api@1.14.2-next.0
|
||||
- @backstage/core-plugin-api@1.9.3
|
||||
- @backstage/theme@0.5.6
|
||||
- @backstage/types@1.1.1
|
||||
|
||||
## 1.5.9-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/core-app-api@1.14.1-next.0
|
||||
- @backstage/config@1.2.0
|
||||
- @backstage/core-plugin-api@1.9.3
|
||||
- @backstage/theme@0.5.6
|
||||
- @backstage/types@1.1.1
|
||||
- @backstage/plugin-permission-common@0.8.0
|
||||
- @backstage/plugin-permission-react@0.4.24
|
||||
|
||||
## 1.5.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 95a3a0b: Rename frontend and backend `setupRequestMockHandlers` methods to `registerMswTestHooks`.
|
||||
- Updated dependencies
|
||||
- @backstage/plugin-permission-common@0.8.0
|
||||
- @backstage/core-app-api@1.14.0
|
||||
- @backstage/plugin-permission-react@0.4.24
|
||||
- @backstage/config@1.2.0
|
||||
- @backstage/core-plugin-api@1.9.3
|
||||
- @backstage/theme@0.5.6
|
||||
- @backstage/types@1.1.1
|
||||
|
||||
## 1.5.8-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -199,6 +199,13 @@ export type MockStorageBucket = {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
// @public
|
||||
export function registerMswTestHooks(worker: {
|
||||
listen: (t: any) => void;
|
||||
close: () => void;
|
||||
resetHandlers: () => void;
|
||||
}): void;
|
||||
|
||||
// @public
|
||||
export function renderInTestApp(
|
||||
Component: ComponentType<PropsWithChildren<{}>> | ReactNode,
|
||||
@@ -211,7 +218,7 @@ export function renderWithEffects(
|
||||
options?: Pick<RenderOptions, 'wrapper'> & LegacyRootOption,
|
||||
): Promise<RenderResult>;
|
||||
|
||||
// @public
|
||||
// @public @deprecated (undocumented)
|
||||
export function setupRequestMockHandlers(worker: {
|
||||
listen: (t: any) => void;
|
||||
close: () => void;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@backstage/test-utils",
|
||||
"version": "1.5.8-next.1",
|
||||
"version": "1.5.10-next.2",
|
||||
"description": "Utilities to test Backstage plugins and apps.",
|
||||
"backstage": {
|
||||
"role": "web-library"
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { registerMswTestHooks } from './testUtils/msw';
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `registerMswTestHooks` from `@backstage/test-utils` instead.
|
||||
*/
|
||||
export function setupRequestMockHandlers(worker: {
|
||||
listen: (t: any) => void;
|
||||
close: () => void;
|
||||
resetHandlers: () => void;
|
||||
}): void {
|
||||
registerMswTestHooks(worker);
|
||||
}
|
||||
@@ -20,4 +20,5 @@
|
||||
* @packageDocumentation
|
||||
*/
|
||||
|
||||
export * from './deprecated';
|
||||
export * from './testUtils';
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
import { setupRequestMockHandlers } from '../../msw';
|
||||
import { registerMswTestHooks } from '../../msw';
|
||||
import { MockFetchApi } from './MockFetchApi';
|
||||
|
||||
describe('MockFetchApi', () => {
|
||||
const worker = setupServer();
|
||||
setupRequestMockHandlers(worker);
|
||||
registerMswTestHooks(worker);
|
||||
|
||||
it('works with default constructor', async () => {
|
||||
worker.use(
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { setupRequestMockHandlers } from './setupRequestMockHandlers';
|
||||
export { registerMswTestHooks } from './registerMswTestHooks';
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
* @public
|
||||
* @param worker - service worker
|
||||
*/
|
||||
export function setupRequestMockHandlers(worker: {
|
||||
export function registerMswTestHooks(worker: {
|
||||
listen: (t: any) => void;
|
||||
close: () => void;
|
||||
resetHandlers: () => void;
|
||||
Reference in New Issue
Block a user