Merge pull request #25569 from backstage/nbs10/rename-setup-request-handlers

[NBS 1.0]Rename `setupRequestMockHandlers` to `registerMswTestHooks`
This commit is contained in:
Patrik Oldsberg
2024-07-16 11:01:29 +02:00
committed by GitHub
107 changed files with 299 additions and 201 deletions
+8 -1
View File
@@ -367,6 +367,13 @@ export namespace mockServices {
}
}
// @public
export function registerMswTestHooks(worker: {
listen: (t: any) => void;
close: () => void;
resetHandlers: () => void;
}): void;
// @public
export class ServiceFactoryTester<TService, TScope extends 'root' | 'plugin'> {
static from<TService, TScope extends 'root' | 'plugin'>(
@@ -402,7 +409,7 @@ export type ServiceMock<TService> = {
: TService[Key];
};
// @public
// @public @deprecated (undocumented)
export function setupRequestMockHandlers(worker: {
listen: (t: any) => void;
close: () => void;
@@ -14,6 +14,7 @@
* limitations under the License.
*/
import { registerMswTestHooks } from './msw';
import { CreateMockDirectoryOptions } from './filesystem';
import { isDockerDisabledForTests as _isDockerDisabledForTests } from './util';
@@ -23,6 +24,18 @@ import { isDockerDisabledForTests as _isDockerDisabledForTests } from './util';
*/
export type MockDirectoryOptions = CreateMockDirectoryOptions;
/**
* @public
* @deprecated Use `registerMswTestHooks` from `@backstage/backend-test-utils` instead.
*/
export function setupRequestMockHandlers(worker: {
listen: (t: any) => void;
close: () => void;
resetHandlers: () => void;
}): void {
registerMswTestHooks(worker);
}
/**
* @public
* @deprecated This is an internal function and will no longer be exported from this package.
+1 -1
View File
@@ -14,4 +14,4 @@
* limitations under the License.
*/
export { setupRequestMockHandlers } from './setupRequestMockHandlers';
export { registerMswTestHooks } from './registerMswTestHooks';
@@ -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;