From efea20feb54b1934507f9f78da4d5251b4b47982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Fri, 23 Sep 2016 11:16:26 +0200 Subject: [PATCH] Normalize line endings to support both LF and CRLF This should fix build failures on Windows caused by line-ending mismatch. --- test/executor.test.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/executor.test.js b/test/executor.test.js index 3f98556..3a5e66c 100644 --- a/test/executor.test.js +++ b/test/executor.test.js @@ -804,10 +804,11 @@ describe('executor', function() { .get('/') .end(function(err, res) { if (err) return done(err); - expect(res.text).to.eql(('\n\n\n' + + var EXPECTED_TEXT = '\n\n\n' + ' \n simple-app\n' + '\n\n

simple-app

\n' + - '\n').replace(/\n/g, os.EOL)); + '\n'; + expect(normalizeEols(res.text)).to.eql(normalizeEols(EXPECTED_TEXT)); done(); }); }); @@ -1129,3 +1130,7 @@ function envAppInstructions() { env: 'test', }); } + +function normalizeEols(str) { + return str.replace(/\r\n/g, '\n'); +}