|
|
|
@ -3,7 +3,6 @@
|
|
|
|
|
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 +41,17 @@ describe('minifier', function () {
|
|
|
|
|
assert(file.existsSync(destPath));
|
|
|
|
|
|
|
|
|
|
assert.strictEqual(
|
|
|
|
|
fs.readFileSync(destPath).toString(),
|
|
|
|
|
'(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
|
|
|
|
|
fs.readFileSync(destPath).toString().replace(/\r\n/g, '\n'),
|
|
|
|
|
'(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'
|
|
|
|
|
);
|
|
|
|
|
done();
|
|
|
|
|
});
|
|
|
|
|