32 lines
1.3 KiB
JavaScript
32 lines
1.3 KiB
JavaScript
import assert from 'node:assert/strict';
|
|
import { readFile } from 'node:fs/promises';
|
|
import test from 'node:test';
|
|
|
|
const forbidden = [/\[\[/, /\{\{/, /~~NOCACHE~~/, /NEWPAGE>/, /indexmenu>/];
|
|
|
|
for (const file of [
|
|
'src/content/docs/bachelor/index.md',
|
|
'src/content/docs/bachelor/year-1/index.md',
|
|
'src/content/docs/bachelor/year-1/project-1-1.md',
|
|
'src/content/docs/bachelor/year-1/project-1-2.md',
|
|
'src/content/docs/bachelor/year-2/index.md',
|
|
'src/content/docs/bachelor/year-2/honours-programme.md',
|
|
'src/content/docs/bachelor/year-2/project-2-1.md',
|
|
'src/content/docs/bachelor/year-2/project-2-2.md',
|
|
]) {
|
|
test(`${file} contains clean migrated Markdown`, async () => {
|
|
const content = await readFile(file, 'utf8');
|
|
assert.match(content, /^---\n[\s\S]*title:/);
|
|
assert.match(content, /This information originated in the previous wiki and may be outdated\./);
|
|
for (const pattern of forbidden) assert.doesNotMatch(content, pattern);
|
|
});
|
|
}
|
|
|
|
test('Year 2 honours programme retains its awaiting-content notice', async () => {
|
|
const content = await readFile(
|
|
'src/content/docs/bachelor/year-2/honours-programme.md',
|
|
'utf8',
|
|
);
|
|
assert.match(content, /:::note\[Awaiting content\]/);
|
|
assert.match(content, /This page is awaiting content\./);
|
|
});
|