openapi-utils: rename export

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
Vincenzo Scamporlino
2025-01-23 13:39:34 +01:00
parent df43519ede
commit 25350e9e5d
6 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -2,16 +2,16 @@
'@backstage/backend-openapi-utils': minor
---
_BREAKING_: The `wrapInOpenApiTestServer` and `wrapServer` functions are now exported via `/tests` subpath. If you were importing these functions directly from the root of the package, you will need to update your imports to use the `/tests` subpath:
**BREAKING**: The `wrapInOpenApiTestServer` and `wrapServer` functions are now exported via `/testUtils` subpath. If you were importing these functions directly from the root of the package, you will need to update your imports to use the `/testUtils` subpath:
```diff
- import { wrapInOpenApiTestServer } from '@backstage/backend-openapi-utils';
+ import { wrapInOpenApiTestServer } from '@backstage/backend-openapi-utils/tests';
+ import { wrapInOpenApiTestServer } from '@backstage/backend-openapi-utils/testUtils';
```
or
```diff
- import { wrapServer } from '@backstage/backend-openapi-utils';
+ import { wrapServer } from '@backstage/backend-openapi-utils/tests';
+ import { wrapServer } from '@backstage/backend-openapi-utils/testUtils';
```
+1 -1
View File
@@ -97,7 +97,7 @@ For more information, see [the docs](./generate-client.md).
Add the following lines to your `createRouter.test.ts` or `router.test.ts` file,
```diff
+ import { wrapInOpenApiTestServer } from '@backstage/backend-openapi-utils/tests';
+ import { wrapInOpenApiTestServer } from '@backstage/backend-openapi-utils/testUtils';
+ import { Server } from 'http';
...
+2 -2
View File
@@ -17,14 +17,14 @@
"license": "Apache-2.0",
"exports": {
".": "./src/index.ts",
"./tests": "./src/testUtils.ts",
"./testUtils": "./src/testUtils.ts",
"./package.json": "./package.json"
},
"main": "src/index.ts",
"types": "src/index.ts",
"typesVersions": {
"*": {
"tests": [
"testUtils": [
"src/testUtils.ts"
],
"package.json": [
@@ -15,7 +15,7 @@
*/
import { MiddlewareFactory } from '@backstage/backend-defaults/rootHttpRouter';
import { wrapServer } from '@backstage/backend-openapi-utils/tests';
import { wrapServer } from '@backstage/backend-openapi-utils/testUtils';
import { mockCredentials, mockServices } from '@backstage/backend-test-utils';
import type { Location } from '@backstage/catalog-client';
import {
@@ -23,7 +23,7 @@ import {
import express from 'express';
import request from 'supertest';
import { createRouter } from './router';
import { wrapServer } from '@backstage/backend-openapi-utils/tests';
import { wrapServer } from '@backstage/backend-openapi-utils/testUtils';
import { Server } from 'http';
import {
mockCredentials,