@backstage/frontend-test-utils 0.1.10-next.2 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @backstage/frontend-test-utils
2
2
 
3
+ ## 0.1.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 95a3a0b: Rename frontend and backend `setupRequestMockHandlers` methods to `registerMswTestHooks`.
8
+ - Updated dependencies
9
+ - @backstage/frontend-app-api@0.7.3
10
+ - @backstage/test-utils@1.5.8
11
+ - @backstage/frontend-plugin-api@0.6.7
12
+ - @backstage/types@1.1.1
13
+
3
14
  ## 0.1.10-next.2
4
15
 
5
16
  ### Patch Changes
@@ -0,0 +1,8 @@
1
+ import { registerMswTestHooks } from '@backstage/test-utils';
2
+
3
+ function setupRequestMockHandlers(worker) {
4
+ registerMswTestHooks(worker);
5
+ }
6
+
7
+ export { setupRequestMockHandlers };
8
+ //# sourceMappingURL=deprecated.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecated.esm.js","sources":["../src/deprecated.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { registerMswTestHooks } from '@backstage/test-utils';\n\n/**\n * @public\n * @deprecated Use `registerMswTestHooks` from `@backstage/frontend-test-utils` instead.\n */\nexport function setupRequestMockHandlers(worker: {\n listen: (t: any) => void;\n close: () => void;\n resetHandlers: () => void;\n}): void {\n registerMswTestHooks(worker);\n}\n"],"names":[],"mappings":";;AAsBO,SAAS,yBAAyB,MAIhC,EAAA;AACP,EAAA,oBAAA,CAAqB,MAAM,CAAA,CAAA;AAC7B;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,20 @@
1
1
  /// <reference types="react" />
2
- export { ErrorWithContext, MockConfigApi, MockErrorApi, MockErrorApiOptions, MockFetchApi, MockFetchApiOptions, MockPermissionApi, MockStorageApi, MockStorageBucket, TestApiProvider, TestApiProviderProps, TestApiRegistry, setupRequestMockHandlers, withLogCollector } from '@backstage/test-utils';
2
+ export { ErrorWithContext, MockConfigApi, MockErrorApi, MockErrorApiOptions, MockFetchApi, MockFetchApiOptions, MockPermissionApi, MockStorageApi, MockStorageBucket, TestApiProvider, TestApiProviderProps, TestApiRegistry, registerMswTestHooks, withLogCollector } from '@backstage/test-utils';
3
3
  import { AnalyticsApi, AnalyticsEvent, ExtensionDefinition, RouteRef } from '@backstage/frontend-plugin-api';
4
4
  import * as _testing_library_react from '@testing-library/react';
5
5
  import { RenderResult } from '@testing-library/react';
6
6
  import { JsonObject } from '@backstage/types';
7
7
 
8
+ /**
9
+ * @public
10
+ * @deprecated Use `registerMswTestHooks` from `@backstage/frontend-test-utils` instead.
11
+ */
12
+ declare function setupRequestMockHandlers(worker: {
13
+ listen: (t: any) => void;
14
+ close: () => void;
15
+ resetHandlers: () => void;
16
+ }): void;
17
+
8
18
  /**
9
19
  * Mock implementation of {@link frontend-plugin-api#AnalyticsApi} with helpers to ensure that events are sent correctly.
10
20
  * Use getEvents in tests to verify captured events.
@@ -63,4 +73,4 @@ type TestAppOptions = {
63
73
  */
64
74
  declare function renderInTestApp(element: JSX.Element, options?: TestAppOptions): _testing_library_react.RenderResult;
65
75
 
66
- export { ExtensionTester, MockAnalyticsApi, type TestAppOptions, createExtensionTester, renderInTestApp };
76
+ export { ExtensionTester, MockAnalyticsApi, type TestAppOptions, createExtensionTester, renderInTestApp, setupRequestMockHandlers };
package/dist/index.esm.js CHANGED
@@ -1,4 +1,5 @@
1
- export { MockConfigApi, MockErrorApi, MockFetchApi, MockPermissionApi, MockStorageApi, TestApiProvider, TestApiRegistry, setupRequestMockHandlers, withLogCollector } from '@backstage/test-utils';
1
+ export { setupRequestMockHandlers } from './deprecated.esm.js';
2
+ export { MockConfigApi, MockErrorApi, MockFetchApi, MockPermissionApi, MockStorageApi, TestApiProvider, TestApiRegistry, registerMswTestHooks, withLogCollector } from '@backstage/test-utils';
2
3
  export { MockAnalyticsApi } from './apis/AnalyticsApi/MockAnalyticsApi.esm.js';
3
4
  export { createExtensionTester } from './app/createExtensionTester.esm.js';
4
5
  export { renderInTestApp } from './app/renderInTestApp.esm.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/frontend-test-utils",
3
- "version": "0.1.10-next.2",
3
+ "version": "0.1.10",
4
4
  "backstage": {
5
5
  "role": "web-library"
6
6
  },
@@ -31,13 +31,13 @@
31
31
  "test": "backstage-cli package test"
32
32
  },
33
33
  "dependencies": {
34
- "@backstage/frontend-app-api": "^0.7.3-next.2",
35
- "@backstage/frontend-plugin-api": "^0.6.7-next.1",
36
- "@backstage/test-utils": "^1.5.8-next.1",
34
+ "@backstage/frontend-app-api": "^0.7.3",
35
+ "@backstage/frontend-plugin-api": "^0.6.7",
36
+ "@backstage/test-utils": "^1.5.8",
37
37
  "@backstage/types": "^1.1.1"
38
38
  },
39
39
  "devDependencies": {
40
- "@backstage/cli": "^0.26.11-next.1",
40
+ "@backstage/cli": "^0.26.11",
41
41
  "@testing-library/jest-dom": "^6.0.0",
42
42
  "@types/react": "*"
43
43
  },