deprecate MockFetchApi class, keep MockFetchApiOptions
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
'@backstage/frontend-test-utils': patch
|
||||
---
|
||||
|
||||
Deprecated standalone mock API exports in favor of the `mockApis` namespace. This includes the mock classes (`MockAlertApi`, `MockAnalyticsApi`, `MockConfigApi`, `MockErrorApi`, `MockFeatureFlagsApi`, `MockPermissionApi`, `MockStorageApi`, `MockTranslationApi`), their option types (`MockErrorApiOptions`, `MockFeatureFlagsApiOptions`), and the `ErrorWithContext` type. `MockFetchApi`, `MockFetchApiOptions` are kept as non-deprecated exports. Use the `mockApis` namespace instead, for example `mockApis.alert()` or `mockApis.alert.mock()`.
|
||||
Deprecated standalone mock API exports in favor of the `mockApis` namespace. This includes the mock classes (`MockAlertApi`, `MockAnalyticsApi`, `MockConfigApi`, `MockErrorApi`, `MockFetchApi`, `MockFeatureFlagsApi`, `MockPermissionApi`, `MockStorageApi`, `MockTranslationApi`), their option types (`MockErrorApiOptions`, `MockFeatureFlagsApiOptions`), and the `ErrorWithContext` type. `MockFetchApiOptions` is kept as a non-deprecated export. Use the `mockApis` namespace instead, for example `mockApis.alert()` or `mockApis.alert.mock()`.
|
||||
|
||||
@@ -344,7 +344,7 @@ export interface MockFeatureFlagsApiOptions {
|
||||
initialStates?: Record<string, FeatureFlagState>;
|
||||
}
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export class MockFetchApi implements FetchApi {
|
||||
constructor(options?: MockFetchApiOptions);
|
||||
get fetch(): typeof fetch;
|
||||
|
||||
@@ -89,6 +89,7 @@ export interface MockFetchApiOptions {
|
||||
* A test helper implementation of {@link @backstage/core-plugin-api#FetchApi}.
|
||||
*
|
||||
* @public
|
||||
* @deprecated Use `mockApis.fetch()` instead.
|
||||
*/
|
||||
export class MockFetchApi implements FetchApi {
|
||||
private readonly implementation: FetchApi;
|
||||
|
||||
@@ -66,6 +66,7 @@ export type { ErrorWithContext } from './ErrorApi/MockErrorApi';
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `mockApis.fetch()` instead.
|
||||
*/
|
||||
export type { MockFetchApi } from './FetchApi';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user