fix(core): sortRoutes shouldn't have a default baseUrl value, this led to a bug (#10054)

This commit is contained in:
Sébastien Lorber 2024-04-18 15:08:30 +02:00 committed by GitHub
parent 4772b27a63
commit 128738786b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 58 additions and 20 deletions

View file

@ -58,7 +58,7 @@ Available ids are:\n- ${version.docs.map((d) => d.id).join('\n- ')}`,
}
const createFakeActions = (contentDir: string) => {
const routeConfigs: RouteConfig[] = [];
let routeConfigs: RouteConfig[] = [];
const dataContainer: {[key: string]: unknown} = {};
const globalDataContainer: {pluginName?: {pluginId: unknown}} = {};
@ -83,7 +83,7 @@ const createFakeActions = (contentDir: string) => {
expectSnapshot: () => {
// Sort the route config like in src/server/plugins/index.ts for
// consistent snapshot ordering
sortRoutes(routeConfigs);
routeConfigs = sortRoutes(routeConfigs, '/');
expect(routeConfigs).not.toEqual([]);
expect(routeConfigs).toMatchSnapshot('route config');
expect(dataContainer).toMatchSnapshot('data');