From 695f5e8e695a8a434a066f525b39c7a68ab4555f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lohrer?= Date: Tue, 21 Apr 2026 09:05:53 +0200 Subject: [PATCH] =?UTF-8?q?test:=20filterPostDirs=20f=C3=BCr=20sprach-eben?= =?UTF-8?q?e=20(failing)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/tests/change-detection_test.ts | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/publish/tests/change-detection_test.ts b/publish/tests/change-detection_test.ts index 8da17cd..51b9b9e 100644 --- a/publish/tests/change-detection_test.ts +++ b/publish/tests/change-detection_test.ts @@ -53,3 +53,33 @@ Deno.test('changedPostDirs: nutzt git diff --name-only A..B', async () => { }) assertEquals(dirs, ['content/posts/x']) }) + +Deno.test('filterPostDirs: extrahiert post-ordner mit sprach-ebene', () => { + const lines = [ + 'content/posts/de/a/index.md', + 'content/posts/en/b/image.png', + 'content/posts/de/c/index.md', + 'README.md', + ] + assertEquals( + filterPostDirs(lines, 'content/posts').sort(), + ['content/posts/de/a', 'content/posts/de/c', 'content/posts/en/b'], + ) +}) + +Deno.test('filterPostDirs: ignoriert dateien direkt unter lang-ordner', () => { + const lines = [ + 'content/posts/de/index.md', + 'content/posts/de/README.md', + 'content/posts/de/x/index.md', + ] + assertEquals(filterPostDirs(lines, 'content/posts'), ['content/posts/de/x']) +}) + +Deno.test('filterPostDirs: _drafts unter sprach-ebene wird ignoriert', () => { + const lines = [ + 'content/posts/de/_drafts/x/index.md', + 'content/posts/de/real/index.md', + ] + assertEquals(filterPostDirs(lines, 'content/posts'), ['content/posts/de/real']) +})