test: fix Windows-only test failures so CI matrix runs clean

Two pre-existing Windows-specific failures blocked the CI release
matrix from publishing the Windows build:

  - tests/main/DailyNotes.test.js: 'joins dir + YYYY-MM-DD.md' used
    a hard-coded '/tmp/notes/2026-09-13.md' expected value. On
    POSIX path.join returns '/' and the test passes; on Windows
    path.join returns '\' and the test fails. Fix: build the
    expected value via path.join so it matches the platform.

  - tests/main/PDFBatchOperations.test.js: 'watermarks every PDF
    including subfolders' used the default 5s Jest timeout. Windows
    CI runners are slower at pdf-lib / pdfjs-dist cold-start and the
    test regularly exceeded 5s. Fix: jest.setTimeout(30000) at the
    start of the watermark describe block.

Neither is a regression — both predate this session. The fix gets
the Windows job green so the release matrix completes 3/3.

Amit Haridas
This commit is contained in:
2026-09-30 23:12:59 +05:30
parent a6407b5839
commit bd620284ab
2 changed files with 11 additions and 1 deletions
+5 -1
View File
@@ -26,7 +26,11 @@ describe('DailyNotes.dateKey', () => {
describe('DailyNotes.pathFor', () => {
test('joins dir + YYYY-MM-DD.md', () => {
const d = new Date(2026, 8, 13);
expect(DailyNotes.pathFor(d, '/tmp/notes', path)).toBe('/tmp/notes/2026-09-13.md');
// Use path.join to build the expected value so the test passes on
// Windows (where path.join returns backslashes) as well as POSIX.
expect(DailyNotes.pathFor(d, '/tmp/notes', path)).toBe(
path.join('/tmp/notes', '2026-09-13.md')
);
});
});