test: read the wrapped mkdir in the Dockerfile as one command

This commit is contained in:
Linus Rath
2026-11-01 00:47:30 +01:00
parent c0c1a8f0fb
commit 23b50f8268
+2 -1
View File
@@ -59,7 +59,8 @@ describe('docker data volumes', () => {
});
it('creates every default state folder in the image', () => {
const dockerfile = readFileSync(path.join(ROOT, 'Dockerfile'), 'utf8');
// Join backslash-continued lines so a wrapped mkdir is read whole.
const dockerfile = readFileSync(path.join(ROOT, 'Dockerfile'), 'utf8').replace(/\\\r?\n\s*/g, ' ');
const created = dockerfile.match(/RUN mkdir -p ([^&\n]+)/)?.[1].trim().split(/\s+/) ?? [];
for (const dir of defaultStateDirs()) expect(created).toContain(dir);
});