frontend-test-utils: re-export APIs from test-utils

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-11-27 13:43:06 +01:00
parent 471218f630
commit c21c9cf07b
4 changed files with 86 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/frontend-test-utils': patch
---
Re-export mock API implementations as well as `TestApiProvider`, TestApiRegistry`, `withLogCollector`and`setupRequestMockHandlers`froom`@backstage/test-utils`.
@@ -3,9 +3,24 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { ErrorWithContext } from '@backstage/test-utils';
import { Extension } from '@backstage/frontend-plugin-api';
import { JsonObject } from '@backstage/types';
import { MockAnalyticsApi } from '@backstage/test-utils';
import { MockConfigApi } from '@backstage/test-utils';
import { MockErrorApi } from '@backstage/test-utils';
import { MockErrorApiOptions } from '@backstage/test-utils';
import { MockFetchApi } from '@backstage/test-utils';
import { MockFetchApiOptions } from '@backstage/test-utils';
import { MockPermissionApi } from '@backstage/test-utils';
import { MockStorageApi } from '@backstage/test-utils';
import { MockStorageBucket } from '@backstage/test-utils';
import { RenderResult } from '@testing-library/react';
import { setupRequestMockHandlers } from '@backstage/test-utils';
import { TestApiProvider } from '@backstage/test-utils';
import { TestApiProviderProps } from '@backstage/test-utils';
import { TestApiRegistry } from '@backstage/test-utils';
import { withLogCollector } from '@backstage/test-utils';
// @public (undocumented)
export function createExtensionTester<TConfig>(
@@ -15,6 +30,8 @@ export function createExtensionTester<TConfig>(
},
): ExtensionTester;
export { ErrorWithContext };
// @public (undocumented)
export class ExtensionTester {
// (undocumented)
@@ -27,4 +44,32 @@ export class ExtensionTester {
// (undocumented)
render(options?: { config?: JsonObject }): RenderResult;
}
export { MockAnalyticsApi };
export { MockConfigApi };
export { MockErrorApi };
export { MockErrorApiOptions };
export { MockFetchApi };
export { MockFetchApiOptions };
export { MockPermissionApi };
export { MockStorageApi };
export { MockStorageBucket };
export { setupRequestMockHandlers };
export { TestApiProvider };
export { TestApiProviderProps };
export { TestApiRegistry };
export { withLogCollector };
```
@@ -0,0 +1,28 @@
/*
* Copyright 2023 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.
*/
export {
MockAnalyticsApi,
MockConfigApi,
type ErrorWithContext,
MockErrorApi,
type MockErrorApiOptions,
MockFetchApi,
type MockFetchApiOptions,
MockPermissionApi,
MockStorageApi,
type MockStorageBucket,
} from '@backstage/test-utils';
@@ -20,4 +20,12 @@
* Contains utilities that can be used when testing frontend features such as extensions.
*/
export * from './apis';
export * from './app';
export { TestApiProvider, TestApiRegistry } from '@backstage/test-utils';
export type { TestApiProviderProps } from '@backstage/test-utils';
export { withLogCollector } from '@backstage/test-utils';
export { setupRequestMockHandlers } from '@backstage/test-utils';