chore: fix backend-test-utils changeset

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
benjdlambert
2025-06-17 13:51:59 +02:00
parent a7554ba479
commit 8f16117831
+26 -1
View File
@@ -2,4 +2,29 @@
'@backstage/backend-test-utils': minor
---
Added mock implementations for `ActionsService` and `ActionsRegistryService`
Added an `actionsRegistryServiceMock` and `actionsServiceMock` to `/alpha` export for the experimental services.
This allows you to write tests for your actions by doing something similar to the following:
```ts
import { actionsRegistryServiceMock } from '@backstage/backend-test-utils/alpha`;
const mockActionsRegistry = actionsRegistryServiceMock();
const mockCatalog = catalogServiceMock({
entities: [
...
],
});
createGetCatalogEntityAction({
catalog: mockCatalog,
actionsRegistry: mockActionsRegistry,
});
await expect(
mockActionsRegistry.invoke({
id: 'test:get-catalog-entity',
input: { name: 'test' },
}),
).resolves.toEqual(...)
```