improve mocha tests (#3195)
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user