From d1dd0cd6df82d1b1362d839f0b42dc09c5bba8d5 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Fri, 26 May 2017 13:12:17 -0400 Subject: [PATCH] fix concat test on windows --- src/meta/minifier.js | 2 +- test/build.js | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/meta/minifier.js b/src/meta/minifier.js index e9b6243d2f..ea911e5aaf 100644 --- a/src/meta/minifier.js +++ b/src/meta/minifier.js @@ -174,7 +174,7 @@ function concat(data, callback) { return callback(err); } - var output = files.join('\n;'); + var output = files.join(os.EOL + ';'); fs.writeFile(data.destPath, output, callback); }); diff --git a/test/build.js b/test/build.js index 9fc8230992..b8687d86bb 100644 --- a/test/build.js +++ b/test/build.js @@ -3,6 +3,7 @@ var string = require('string'); var path = require('path'); var fs = require('fs'); +var os = require('os'); var assert = require('assert'); var mkdirp = require('mkdirp'); var rimraf = require('rimraf'); @@ -42,16 +43,15 @@ describe('minifier', function () { assert.strictEqual( fs.readFileSync(destPath).toString(), - '(function (window, document) {' + - '\n\twindow.doStuff = function () {' + - '\n\t\tdocument.body.innerHTML = \'Stuff has been done\';' + - '\n\t};' + - '\n})(window, document);' + - '\n' + - '\n;function foo(name, age) {' + - '\n\treturn \'The person known as "\' + name + \'" is \' + age + \' years old\';' + - '\n}' + - '\n' + '(function (window, document) {' + os.EOL + + '\twindow.doStuff = function () {' + os.EOL + + '\t\tdocument.body.innerHTML = \'Stuff has been done\';' + os.EOL + + '\t};' + os.EOL + + '})(window, document);' + os.EOL + + os.EOL + + ';function foo(name, age) {' + os.EOL + + '\treturn \'The person known as "\' + name + \'" is \' + age + \' years old\';' + os.EOL + + '}' + os.EOL ); done(); });