aboutsummaryrefslogtreecommitdiff
path: root/test/mocha/spidermonkey.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-06-22 01:04:15 +0800
committeralexlamsl <alexlamsl@gmail.com>2018-06-24 04:00:36 +0800
commit28330913d871dd4bdb4e59464c7230f9ae4174fa (patch)
tree32fba882ce0d546d14f461677c56e771e10f02e1 /test/mocha/spidermonkey.js
parent766a4147d4891a093b550e958268c48104330b52 (diff)
downloadtracifyjs-28330913d871dd4bdb4e59464c7230f9ae4174fa.tar.gz
tracifyjs-28330913d871dd4bdb4e59464c7230f9ae4174fa.zip
improve `mocha` tests (#3195)
Diffstat (limited to 'test/mocha/spidermonkey.js')
-rw-r--r--test/mocha/spidermonkey.js16
1 files changed, 8 insertions, 8 deletions
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);