diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-06-22 01:04:15 +0800 |
---|---|---|
committer | alexlamsl <alexlamsl@gmail.com> | 2018-06-24 04:00:36 +0800 |
commit | 28330913d871dd4bdb4e59464c7230f9ae4174fa (patch) | |
tree | 32fba882ce0d546d14f461677c56e771e10f02e1 /test/mocha/line-endings.js | |
parent | 766a4147d4891a093b550e958268c48104330b52 (diff) | |
download | tracifyjs-28330913d871dd4bdb4e59464c7230f9ae4174fa.tar.gz tracifyjs-28330913d871dd4bdb4e59464c7230f9ae4174fa.zip |
improve `mocha` tests (#3195)
Diffstat (limited to 'test/mocha/line-endings.js')
-rw-r--r-- | test/mocha/line-endings.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/test/mocha/line-endings.js b/test/mocha/line-endings.js index 6b666813..07e85faf 100644 --- a/test/mocha/line-endings.js +++ b/test/mocha/line-endings.js @@ -1,5 +1,5 @@ -var Uglify = require("../node"); var assert = require("assert"); +var UglifyJS = require("../node"); describe("line-endings", function() { var options = { @@ -14,19 +14,19 @@ describe("line-endings", function() { it("Should parse LF line endings", function() { var js = '/*!one\n2\n3*///comment\nfunction f(x) {\n if (x)\n//comment\n return 3;\n}\n'; - var result = Uglify.minify(js, options); + var result = UglifyJS.minify(js, options); assert.strictEqual(result.code, expected_code); }); it("Should parse CR/LF line endings", function() { var js = '/*!one\r\n2\r\n3*///comment\r\nfunction f(x) {\r\n if (x)\r\n//comment\r\n return 3;\r\n}\r\n'; - var result = Uglify.minify(js, options); + var result = UglifyJS.minify(js, options); assert.strictEqual(result.code, expected_code); }); it("Should parse CR line endings", function() { var js = '/*!one\r2\r3*///comment\rfunction f(x) {\r if (x)\r//comment\r return 3;\r}\r'; - var result = Uglify.minify(js, options); + var result = UglifyJS.minify(js, options); assert.strictEqual(result.code, expected_code); }); @@ -44,16 +44,15 @@ describe("line-endings", function() { ] var test = function(input) { return function() { - Uglify.parse(input); + UglifyJS.parse(input); } } var fail = function(e) { - return e instanceof Uglify.JS_Parse_Error && - e.message === "Unexpected line terminator"; + return e instanceof UglifyJS.JS_Parse_Error + && e.message === "Unexpected line terminator"; } for (var i = 0; i < inputs.length; i++) { assert.throws(test(inputs[i]), fail); } }); }); - |