Skip to content

Commit

Permalink
openapi-utils: rename export
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Scamporlino <[email protected]>
  • Loading branch information
vinzscam committed Jan 23, 2025
1 parent df43519 commit 25350e9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .changeset/thirty-dancers-cheat.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
```
2 changes: 1 addition & 1 deletion docs/openapi/01-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';

...
Expand Down
4 changes: 2 additions & 2 deletions packages/backend-openapi-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion plugins/catalog-backend/src/service/createRouter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion plugins/search-backend/src/service/router.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 25350e9

Please sign in to comment.