diff --git a/backend/tests/unit/composeEnvironment.test.ts b/backend/tests/unit/composeEnvironment.test.ts index add172a..b90926c 100644 --- a/backend/tests/unit/composeEnvironment.test.ts +++ b/backend/tests/unit/composeEnvironment.test.ts @@ -28,7 +28,13 @@ const compose = readFileSync(COMPOSE_PATH, 'utf8'); // A mention inside a comment cannot match, because a comment line starts with #. function environmentEntries(source: string): Map { const entries = new Map(); - for (const line of source.split('\n')) { + // The split pattern tolerates carriage returns. A checkout with CRLF line + // endings, which is every fresh clone on Windows, otherwise leaves a stray + // carriage return that the end-of-line anchor below cannot match, and every + // assertion in this file then silently finds nothing at all. That is exactly + // the failure the "parsed some entries" case exists to catch, and it is how + // this guard was found to be broken. + for (const line of source.split(/\r?\n/)) { const match = /^\s+- ([A-Z_0-9]+)=(.*)$/.exec(line); if (match) { entries.set(match[1], match[2].trim());