From 6d60ddddb9a68465840b16165d547fe6f8626582 Mon Sep 17 00:00:00 2001 From: haelyra <49814733+haelyra@users.noreply.github.com> Date: Mon, 27 Jul 2026 12:39:03 -0400 Subject: [PATCH] test(instincts): normalize retained-content line endings --- tests/scripts/instinct-cli-projects.test.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/scripts/instinct-cli-projects.test.js b/tests/scripts/instinct-cli-projects.test.js index cf3f1a3a9..ae0ff27f2 100644 --- a/tests/scripts/instinct-cli-projects.test.js +++ b/tests/scripts/instinct-cli-projects.test.js @@ -63,6 +63,10 @@ function readJson(filePath) { return JSON.parse(fs.readFileSync(filePath, 'utf8')); } +function normalizeLineEndings(value) { + return value.replace(/\r\n/g, '\n'); +} + function writeInstinct(filePath, id, confidence = 0.9) { fs.mkdirSync(path.dirname(filePath), { recursive: true }); fs.writeFileSync( @@ -376,7 +380,7 @@ test('promote removes only the promoted instinct block from project source', () const result = runCli(root, ['promote', 'promote-me', '--force'], { cwd: repoDir }); assert.strictEqual(result.status, 0, result.stderr); assert.ok(fs.existsSync(path.join(root, 'instincts', 'personal', 'promote-me.yaml'))); - assert.strictEqual(fs.readFileSync(sourceFile, 'utf8'), retainedBlock); + assert.strictEqual(normalizeLineEndings(fs.readFileSync(sourceFile, 'utf8')), retainedBlock); } finally { cleanupDir(root); cleanupDir(repoParent); @@ -445,7 +449,7 @@ test('promote preserves malformed and foreign source blocks while removing targe const result = runCli(root, ['promote', 'promote-foreign', '--force'], { cwd: repoDir }); assert.strictEqual(result.status, 0, result.stderr); assert.ok(fs.existsSync(path.join(root, 'instincts', 'personal', 'promote-foreign.yaml'))); - assert.strictEqual(fs.readFileSync(sourceFile, 'utf8'), `${foreignContent}\n`); + assert.strictEqual(normalizeLineEndings(fs.readFileSync(sourceFile, 'utf8')), `${foreignContent}\n`); } finally { cleanupDir(root); cleanupDir(repoParent);