From 28330913d871dd4bdb4e59464c7230f9ae4174fa Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Fri, 22 Jun 2018 01:04:15 +0800 Subject: improve `mocha` tests (#3195) --- test/mocha/spidermonkey.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/mocha/spidermonkey.js') diff --git a/test/mocha/spidermonkey.js b/test/mocha/spidermonkey.js index 756a2f43..fc4f40cb 100644 --- a/test/mocha/spidermonkey.js +++ b/test/mocha/spidermonkey.js @@ -1,6 +1,6 @@ var assert = require("assert"); var exec = require("child_process").exec; -var uglify = require("../node"); +var UglifyJS = require("../.."); describe("spidermonkey export/import sanity test", function() { it("should produce a functional build when using --self with spidermonkey", function(done) { @@ -25,9 +25,9 @@ describe("spidermonkey export/import sanity test", function() { it("should not add unnecessary escape slashes to regexps", function() { var input = "/[\\\\/]/;"; - var ast = uglify.parse(input).to_mozilla_ast(); + var ast = UglifyJS.parse(input).to_mozilla_ast(); assert.equal( - uglify.AST_Node.from_mozilla_ast(ast).print_to_string(), + UglifyJS.AST_Node.from_mozilla_ast(ast).print_to_string(), input ); }); @@ -99,10 +99,10 @@ describe("spidermonkey export/import sanity test", function() { var counter_directives; var counter_strings; - var checkWalker = new uglify.TreeWalker(function(node, descend) { - if (node instanceof uglify.AST_String) { + var checkWalker = new UglifyJS.TreeWalker(function(node, descend) { + if (node instanceof UglifyJS.AST_String) { counter_strings++; - } else if (node instanceof uglify.AST_Directive) { + } else if (node instanceof UglifyJS.AST_Directive) { counter_directives++; } }); @@ -111,9 +111,9 @@ describe("spidermonkey export/import sanity test", function() { counter_directives = 0; counter_strings = 0; - var ast = uglify.parse(tests[i].input); + var ast = UglifyJS.parse(tests[i].input); var moz_ast = ast.to_mozilla_ast(); - var from_moz_ast = uglify.AST_Node.from_mozilla_ast(moz_ast); + var from_moz_ast = UglifyJS.AST_Node.from_mozilla_ast(moz_ast); from_moz_ast.walk(checkWalker); -- cgit v1.2.3