aboutsummaryrefslogtreecommitdiff
path: root/test/mocha
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-05-08 03:24:42 +0800
committerGitHub <noreply@github.com>2017-05-08 03:24:42 +0800
commit4f8ca4626efb15dc986785c89c51cbb3061e5f32 (patch)
tree868a08425b50c70f0654a7ee675851da2633a53a /test/mocha
parente54748365cba0509c82c089cdc2ef6a8bb1a724b (diff)
downloadtracifyjs-4f8ca4626efb15dc986785c89c51cbb3061e5f32.tar.gz
tracifyjs-4f8ca4626efb15dc986785c89c51cbb3061e5f32.zip
deprecate low level API (#1877)
fixes #1872
Diffstat (limited to 'test/mocha')
-rw-r--r--test/mocha/accessorTokens-1492.js2
-rw-r--r--test/mocha/arguments.js2
-rw-r--r--test/mocha/cli.js2
-rw-r--r--test/mocha/comment-filter.js2
-rw-r--r--test/mocha/comment.js2
-rw-r--r--test/mocha/directives.js2
-rw-r--r--test/mocha/getter-setter.js2
-rw-r--r--test/mocha/line-endings.js2
-rw-r--r--test/mocha/minify.js9
-rw-r--r--test/mocha/number-literal.js2
-rw-r--r--test/mocha/operator.js2
-rw-r--r--test/mocha/spidermonkey.js15
-rw-r--r--test/mocha/string-literal.js2
-rw-r--r--test/mocha/with.js2
14 files changed, 14 insertions, 34 deletions
diff --git a/test/mocha/accessorTokens-1492.js b/test/mocha/accessorTokens-1492.js
index 861414ee..2b5bbeaa 100644
--- a/test/mocha/accessorTokens-1492.js
+++ b/test/mocha/accessorTokens-1492.js
@@ -1,4 +1,4 @@
-var UglifyJS = require('../../');
+var UglifyJS = require("../node");
var assert = require("assert");
describe("Accessor tokens", function() {
diff --git a/test/mocha/arguments.js b/test/mocha/arguments.js
index 73993a73..998978eb 100644
--- a/test/mocha/arguments.js
+++ b/test/mocha/arguments.js
@@ -1,4 +1,4 @@
-var UglifyJS = require('../../');
+var UglifyJS = require("../node");
var assert = require("assert");
describe("arguments", function() {
diff --git a/test/mocha/cli.js b/test/mocha/cli.js
index 9d8d496f..cac920d3 100644
--- a/test/mocha/cli.js
+++ b/test/mocha/cli.js
@@ -19,7 +19,7 @@ describe("bin/uglifyjs", function () {
eval(stdout);
assert.strictEqual(typeof WrappedUglifyJS, 'object');
- assert.strictEqual(true, WrappedUglifyJS.parse('foo;') instanceof WrappedUglifyJS.AST_Node);
+ assert.strictEqual(WrappedUglifyJS.minify("foo([true,,2+3]);").code, "foo([!0,,5]);");
done();
});
diff --git a/test/mocha/comment-filter.js b/test/mocha/comment-filter.js
index 4b74ebf9..0e4f3dff 100644
--- a/test/mocha/comment-filter.js
+++ b/test/mocha/comment-filter.js
@@ -1,4 +1,4 @@
-var UglifyJS = require('../../');
+var UglifyJS = require("../node");
var assert = require("assert");
describe("comment filters", function() {
diff --git a/test/mocha/comment.js b/test/mocha/comment.js
index acad3693..6b5428d4 100644
--- a/test/mocha/comment.js
+++ b/test/mocha/comment.js
@@ -1,5 +1,5 @@
var assert = require("assert");
-var uglify = require("../../");
+var uglify = require("../node");
describe("Comment", function() {
it("Should recognize eol of single line comments", function() {
diff --git a/test/mocha/directives.js b/test/mocha/directives.js
index 16279a5d..ab8ad57f 100644
--- a/test/mocha/directives.js
+++ b/test/mocha/directives.js
@@ -1,5 +1,5 @@
var assert = require("assert");
-var uglify = require("../../");
+var uglify = require("../node");
describe("Directives", function() {
it ("Should allow tokenizer to store directives state", function() {
diff --git a/test/mocha/getter-setter.js b/test/mocha/getter-setter.js
index 641a2026..83bf5792 100644
--- a/test/mocha/getter-setter.js
+++ b/test/mocha/getter-setter.js
@@ -1,4 +1,4 @@
-var UglifyJS = require('../../');
+var UglifyJS = require("../node");
var assert = require("assert");
describe("Getters and setters", function() {
diff --git a/test/mocha/line-endings.js b/test/mocha/line-endings.js
index 379ee2b9..6b666813 100644
--- a/test/mocha/line-endings.js
+++ b/test/mocha/line-endings.js
@@ -1,4 +1,4 @@
-var Uglify = require('../../');
+var Uglify = require("../node");
var assert = require("assert");
describe("line-endings", function() {
diff --git a/test/mocha/minify.js b/test/mocha/minify.js
index 18840a58..d69ef59c 100644
--- a/test/mocha/minify.js
+++ b/test/mocha/minify.js
@@ -183,13 +183,4 @@ describe("minify", function() {
});
});
});
-
- describe("Compressor", function() {
- it("should be backward compatible with ast.transform(compressor)", function() {
- var ast = Uglify.parse("function f(a){for(var i=0;i<a;i++)console.log(i)}");
- ast.figure_out_scope();
- ast = ast.transform(Uglify.Compressor());
- assert.strictEqual(ast.print_to_string(), "function f(a){for(var i=0;i<a;i++)console.log(i)}");
- });
- })
});
diff --git a/test/mocha/number-literal.js b/test/mocha/number-literal.js
index e80a5313..f4e2f5dd 100644
--- a/test/mocha/number-literal.js
+++ b/test/mocha/number-literal.js
@@ -1,5 +1,5 @@
var assert = require("assert");
-var uglify = require("../../");
+var uglify = require("../node");
describe("Number literals", function () {
it("Should not allow legacy octal literals in strict mode", function() {
diff --git a/test/mocha/operator.js b/test/mocha/operator.js
index adef3abd..64db02c1 100644
--- a/test/mocha/operator.js
+++ b/test/mocha/operator.js
@@ -1,4 +1,4 @@
-var UglifyJS = require("../../");
+var UglifyJS = require("../node");
var assert = require("assert");
describe("operator", function() {
diff --git a/test/mocha/spidermonkey.js b/test/mocha/spidermonkey.js
index e5bf45a2..4071a136 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("../../");
+var uglify = require("../node");
describe("spidermonkey export/import sanity test", function() {
it("should produce a functional build when using --self with spidermonkey", function(done) {
@@ -15,18 +15,7 @@ describe("spidermonkey export/import sanity test", function() {
eval(stdout);
assert.strictEqual(typeof SpiderUglify, "object");
-
- var ast = SpiderUglify.parse("foo([true,,2+3]);");
- assert.strictEqual(true, ast instanceof SpiderUglify.AST_Node);
-
- ast.figure_out_scope();
- ast = SpiderUglify.Compressor({}).compress(ast);
- assert.strictEqual(true, ast instanceof SpiderUglify.AST_Node);
-
- var stream = SpiderUglify.OutputStream({});
- ast.print(stream);
- var code = stream.toString();
- assert.strictEqual(code, "foo([!0,,5]);");
+ assert.strictEqual(SpiderUglify.minify("foo([true,,2+3]);").code, "foo([!0,,5]);");
done();
});
diff --git a/test/mocha/string-literal.js b/test/mocha/string-literal.js
index 6e337a24..fde6db59 100644
--- a/test/mocha/string-literal.js
+++ b/test/mocha/string-literal.js
@@ -1,4 +1,4 @@
-var UglifyJS = require('../../');
+var UglifyJS = require("../node");
var assert = require("assert");
describe("String literals", function() {
diff --git a/test/mocha/with.js b/test/mocha/with.js
index a74ef41a..72fd76ef 100644
--- a/test/mocha/with.js
+++ b/test/mocha/with.js
@@ -1,5 +1,5 @@
var assert = require("assert");
-var uglify = require("../../");
+var uglify = require("../node");
describe("With", function() {
it("Should throw syntaxError when using with statement in strict mode", function() {