refactor(test-utils): deprecate the isDockerDisabledForTests function

Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
Camila Belo
2024-07-10 12:53:32 +02:00
parent 95a3a0b91c
commit b82aff92aa
106 changed files with 329 additions and 272 deletions
+7 -7
View File
@@ -365,6 +365,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,13 +409,6 @@ export type ServiceMock<TService> = {
: TService[Key];
};
// @public
export function setupMswHandlers(worker: {
listen: (t: any) => void;
close: () => void;
resetHandlers: () => void;
}): void;
// @public @deprecated (undocumented)
export function setupRequestMockHandlers(worker: {
listen: (t: any) => void;
+11 -11
View File
@@ -14,9 +14,9 @@
* limitations under the License.
*/
import { registerMswTestHooks } from './msw';
import { CreateMockDirectoryOptions } from './filesystem';
import { isDockerDisabledForTests as _isDockerDisabledForTests } from './util';
import { setupMswHandlers } from './msw';
/**
* @public
@@ -26,20 +26,20 @@ export type MockDirectoryOptions = CreateMockDirectoryOptions;
/**
* @public
* @deprecated This is an internal function and will no longer be exported from this package.
*/
export function isDockerDisabledForTests(): boolean {
return _isDockerDisabledForTests();
}
/**
* @public
* @deprecated Use `setupMswHandlers` from `@backstage/backend-test-utils` instead.
* @deprecated Use `registerMswTestHooks` from `@backstage/backend-test-utils` instead.
*/
export function setupRequestMockHandlers(worker: {
listen: (t: any) => void;
close: () => void;
resetHandlers: () => void;
}): void {
setupMswHandlers(worker);
registerMswTestHooks(worker);
}
/**
* @public
* @deprecated This is an internal function and will no longer be exported from this package.
*/
export function isDockerDisabledForTests(): boolean {
return _isDockerDisabledForTests();
}
+1 -1
View File
@@ -14,4 +14,4 @@
* limitations under the License.
*/
export { setupMswHandlers } from './setupRequestMockHandlers';
export { registerMswTestHooks } from './registerMswTestHooks';
@@ -19,7 +19,7 @@
* @public
* @param worker - service worker
*/
export function setupMswHandlers(worker: {
export function registerMswTestHooks(worker: {
listen: (t: any) => void;
close: () => void;
resetHandlers: () => void;