mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-21 04:57:05 +02:00
fix(core): sortRoutes shouldn't have a default baseUrl value, this led to a bug (#10054)
This commit is contained in:
parent
4772b27a63
commit
128738786b
4 changed files with 58 additions and 20 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue