handleError for SvelteKit 3: ids only for unknown errors, compact 404 log line; error page suggestions prefer the real parent over the section
All checks were successful
Deploy production / deploy (push) Successful in 1m10s

This commit is contained in:
2026-10-25 13:15:41 +00:00
parent 92d6da959d
commit 20ad42b247
5 changed files with 35 additions and 22 deletions

View File

@@ -27,6 +27,10 @@ describe('suggestPages', () => {
expect(hrefs('/trackers/helth')).not.toContain('/trackers/health');
expect(hrefs('/trackers/helth', true)).toContain('/trackers/health');
});
it('ranks the tracker above the section it lives in', () => {
expect(hrefs('/trackers/carz')[0]).toBe('/trackers/cars');
expect(hrefs('/trackers/doesnotexist')).not.toContain('/trackers');
});
it('returns nothing for the home page or noise', () => {
expect(hrefs('/')).toEqual([]);
expect(hrefs('/zzqxj')).toEqual([]);