Refactor backend-test-utils

Co-authored-by: Fredrik Adelöw <freben@users.noreply.github.com>
Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2022-08-12 15:30:24 +02:00
parent 0ef2719b11
commit 0d2e6197d8
9 changed files with 89 additions and 41 deletions
+2 -2
View File
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createServiceRef } from '@backstage/backend-plugin-api';
import { createExtensionPoint } from '@backstage/backend-plugin-api';
import { EntityProvider } from './api';
import { CatalogProcessor } from './api/processor';
@@ -29,6 +29,6 @@ export interface CatalogProcessingExtensionPoint {
* @alpha
*/
export const catalogProcessingExtensionPoint =
createServiceRef<CatalogProcessingExtensionPoint>({
createExtensionPoint<CatalogProcessingExtensionPoint>({
id: 'catalog.processing',
});
@@ -23,8 +23,9 @@ describe('ScaffolderCatalogModule', () => {
it('should register the extension point', async () => {
const extensionPoint = { addProcessor: jest.fn() };
await startTestBackend({
services: [[catalogProcessingExtensionPoint, extensionPoint]],
registrables: [scaffolderCatalogModule({})],
services: [],
extensionPoints: [[catalogProcessingExtensionPoint, extensionPoint]],
features: [scaffolderCatalogModule({})],
});
expect(extensionPoint.addProcessor).toHaveBeenCalledWith(