fix test and update invalid ids

Signed-off-by: Juan Pablo Garcia Ripa <sarabadu@gmail.com>
This commit is contained in:
Juan Pablo Garcia Ripa
2025-07-09 21:55:44 +02:00
parent 5766fc71c6
commit 051b3af31d
2 changed files with 4 additions and 3 deletions
@@ -27,6 +27,7 @@ import {
import { BackendInitializer } from './BackendInitializer';
import { mockServices } from '@backstage/backend-test-utils';
import { BackendStartupError } from './BackendStartupError';
import { CONFIG_KEY_PART_PATTERN } from '@backstage/config';
const baseFactories = [
mockServices.rootLifecycle.factory(),
@@ -1025,7 +1026,7 @@ describe('BackendInitializer', () => {
}),
);
await expect(init.start()).rejects.toThrow(
"Invalid pluginId 'test:invalid&id', must match the pattern /^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i (letters, digits, dashes, and underscores only, starting with a letter)",
`Invalid pluginId 'test:invalid&id', must match the pattern ${CONFIG_KEY_PART_PATTERN} (letters, digits, dashes, and underscores only, starting with a letter)`,
);
});
@@ -1055,7 +1056,7 @@ describe('BackendInitializer', () => {
}),
);
await expect(init.start()).rejects.toThrow(
"Invalid moduleId 'invalid:module&id' for plugin 'test', must match the pattern /^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i (letters, digits, dashes, and underscores only, starting with a letter)",
`Invalid moduleId 'invalid:module&id' for plugin 'test', must match the pattern ${CONFIG_KEY_PART_PATTERN} (letters, digits, dashes, and underscores only, starting with a letter)`,
);
});
@@ -31,7 +31,7 @@ import {
*/
export const dynamicPluginsFrontendSchemas = createBackendModule({
pluginId: 'app',
moduleId: 'core.dynamicplugins.frontendSchemas',
moduleId: 'core-dynamicplugins-frontendSchemas',
register(reg) {
reg.registerInit({
deps: {