Skip to content

Commit

Permalink
[port] improve tests (#3195)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiosantoscode committed Jul 5, 2018
1 parent 330076f commit 1442a0f
Show file tree
Hide file tree
Showing 20 changed files with 754 additions and 522 deletions.
5 changes: 1 addition & 4 deletions test/mocha/arguments.js
@@ -1,17 +1,14 @@
var UglifyJS = require("../node");
var assert = require("assert");
var UglifyJS = require("../..");

describe("arguments", function() {
it("Should known that arguments in functions are local scoped", function() {
var ast = UglifyJS.parse("var arguments; var f = function() {arguments.length}");
ast.figure_out_scope();

// Test scope of `var arguments`
assert.strictEqual(ast.find_variable("arguments").global, true);

// Select arguments symbol in function
var symbol = ast.body[1].definitions[0].value.find_variable("arguments");

assert.strictEqual(symbol.global, false);
assert.strictEqual(symbol.scope, ast. // From ast
body[1]. // Select 2nd statement (equals to `var f ...`)
Expand Down
89 changes: 0 additions & 89 deletions test/mocha/comment-filter.js

This file was deleted.

263 changes: 0 additions & 263 deletions test/mocha/comment.js

This file was deleted.

22 changes: 0 additions & 22 deletions test/mocha/comment_before_constant.js

This file was deleted.

0 comments on commit 1442a0f

Please sign in to comment.