The roof restoration planner has a service path during local development and a dedicated origin in production. A link can work in development while being wrong after deployment if it keeps the development prefix. The shared path helper and the production build assertions give those two environments explicit contracts.
Keep the host and pathname together
The helper checks SITE_NICHE and whether Astro is running in development. When the deployed niche matches the requested slug, its base is slash. For a development link or a different niche, the base starts with the service slug. The canonical for the deployed roof planner uses the roofing hostname and root pathname. The guide uses the same origin and the guide path.
const origin = 'https://roofing.perthquotes.com.au' ; const expected = { home : new URL ( '/' , origin ) , guide : new URL ( '/guide/' , origin ) } ; // Build checks inspect the rendered home and guide, including canonical links. assert . ok ( homeHtml .…