All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 18s
Build & Deploy / 🧪 QA (push) Successful in 1m6s
Build & Deploy / 🏗️ Build (push) Successful in 2m44s
Build & Deploy / 🚀 Deploy (push) Successful in 28s
Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 43s
Build & Deploy / 🔔 Notify (push) Successful in 1s
27 lines
841 B
TypeScript
27 lines
841 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
|
|
describe('English MDX Content Links', () => {
|
|
it('should not contain German slug routes like /en/kontakt or /en/karriere', () => {
|
|
const enContentDir = path.join(process.cwd(), 'content', 'en');
|
|
const files = fs.readdirSync(enContentDir).filter(f => f.endsWith('.mdx'));
|
|
|
|
const forbiddenLinks = ['/en/kontakt', '/en/karriere'];
|
|
const infractions: string[] = [];
|
|
|
|
files.forEach(file => {
|
|
const filePath = path.join(enContentDir, file);
|
|
const content = fs.readFileSync(filePath, 'utf8');
|
|
|
|
forbiddenLinks.forEach(link => {
|
|
if (content.includes(link)) {
|
|
infractions.push(`${file} contains forbidden link "${link}"`);
|
|
}
|
|
});
|
|
});
|
|
|
|
expect(infractions).toEqual([]);
|
|
});
|
|
});
|