mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-06 04:22:07 +00:00
Add tests and cleanup redirects
The changes include: 1. Adding GitHub Actions test job 2. Adding redirect tests 3. Updating redirect configurations 4. Migrating some redirects to SvelteKit routes 5. Test config improvements
This commit is contained in:
10
tests/redirects.test.ts
Normal file
10
tests/redirects.test.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
import redirects from '../src/redirects.json' with { type: 'json' };
|
||||
|
||||
redirects.forEach(({ link, redirect }) => {
|
||||
test(`redirected from ${link} to ${redirect} exists`, async ({ page }) => {
|
||||
const response = await page.goto(redirect);
|
||||
|
||||
expect(response?.ok()).toBeTruthy();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user