backend-test-utils: Remove deprecations
Co-authored-by: Camila Belo <camilaibs@gmail.com> Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
---
|
||||
'@backstage/backend-test-utils': minor
|
||||
---
|
||||
|
||||
Removed these deprecated helpers:
|
||||
|
||||
- `setupRequestMockHandlers` Use `CreateMockDirectoryOptions` instead.
|
||||
- `CreateMockDirectoryOptions` Use `registerMswTestHooks` instead.
|
||||
|
||||
Stopped exporting the deprecated and internal `isDockerDisabledForTests` helper.
|
||||
|
||||
Removed `get` method from `ServiceFactoryTester` which is replaced by `getSubject`
|
||||
@@ -55,9 +55,6 @@ export interface CreateMockDirectoryOptions {
|
||||
mockOsTmpDir?: boolean;
|
||||
}
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export function isDockerDisabledForTests(): boolean;
|
||||
|
||||
// @public (undocumented)
|
||||
export namespace mockCredentials {
|
||||
export function limitedUser(
|
||||
@@ -143,9 +140,6 @@ export interface MockDirectoryContentOptions {
|
||||
shouldReadAsText?: boolean | ((path: string, buffer: Buffer) => boolean);
|
||||
}
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type MockDirectoryOptions = CreateMockDirectoryOptions;
|
||||
|
||||
// @public (undocumented)
|
||||
export namespace mockServices {
|
||||
// (undocumented)
|
||||
@@ -475,10 +469,6 @@ export class ServiceFactoryTester<
|
||||
subject: ServiceFactory<TService, TScope, TInstances>,
|
||||
options?: ServiceFactoryTesterOptions,
|
||||
): ServiceFactoryTester<TService, TScope, TInstances>;
|
||||
// @deprecated
|
||||
get(
|
||||
...args: 'root' extends TScope ? [] : [pluginId?: string]
|
||||
): Promise<TInstances extends 'multiton' ? TService[] : TService>;
|
||||
getService<
|
||||
TGetService,
|
||||
TGetScope extends 'root' | 'plugin',
|
||||
@@ -508,13 +498,6 @@ export type ServiceMock<TService> = {
|
||||
: TService[Key];
|
||||
};
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export function setupRequestMockHandlers(worker: {
|
||||
listen: (t: any) => void;
|
||||
close: () => void;
|
||||
resetHandlers: () => void;
|
||||
}): void;
|
||||
|
||||
// @public (undocumented)
|
||||
export function startTestBackend<TExtensionPoints extends any[]>(
|
||||
options: TestBackendOptions<TExtensionPoints>,
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* 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 './msw';
|
||||
import { CreateMockDirectoryOptions } from './filesystem';
|
||||
import { isDockerDisabledForTests as _isDockerDisabledForTests } from './util';
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `CreateMockDirectoryOptions` from `@backstage/backend-test-utils` instead.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
export function isDockerDisabledForTests(): boolean {
|
||||
return _isDockerDisabledForTests();
|
||||
}
|
||||
@@ -20,7 +20,6 @@
|
||||
* @packageDocumentation
|
||||
*/
|
||||
|
||||
export * from './deprecated';
|
||||
export * from './cache';
|
||||
export * from './database';
|
||||
export * from './msw';
|
||||
|
||||
@@ -82,17 +82,6 @@ export class ServiceFactoryTester<
|
||||
this.#registry = registry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the service instance for the subject.
|
||||
*
|
||||
* @deprecated Use `getSubject` instead.
|
||||
*/
|
||||
async get(
|
||||
...args: 'root' extends TScope ? [] : [pluginId?: string]
|
||||
): Promise<TInstances extends 'multiton' ? TService[] : TService> {
|
||||
return this.getSubject(...args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the service instance for the subject.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user