浏览代码

fixed tests

sanex3339 8 年之前
父节点
当前提交
1456e631f2
共有 2 个文件被更改,包括 8 次插入9 次删除
  1. 0 4
      test/JavaScriptObfuscator.spec.ts
  2. 8 5
      test/OptionsNormalizer.spec.ts

+ 0 - 4
test/JavaScriptObfuscator.spec.ts

@@ -4,10 +4,6 @@ import { NO_CUSTOM_NODES_PRESET } from "../src/preset-options/NoCustomNodesPrese
 
 const assert: Chai.AssertStatic = require('chai').assert;
 
-beforeEach(() => {
-    console.log(Object.assign);
-});
-
 describe('JavaScriptObfuscator', () => {
     describe('obfuscate (sourceCode: string, customOptions?: IOptionsPreset): string', () => {
         it('should obfuscate simple code with variable inside global scope', () => {

+ 8 - 5
test/OptionsNormalizer.spec.ts

@@ -8,18 +8,21 @@ const assert: Chai.AssertStatic = require('chai').assert;
 
 describe('OptionsNormalizer', () => {
     describe('normalizeOptionsPreset (options: IOptionsPreset): IOptionsPreset', () => {
-        let optionsPreset1: IOptionsPreset = Object.assign({}, DEFAULT_PRESET, {
+        let optionsPreset1: IOptionsPreset,
+            optionsPreset2: IOptionsPreset;
+
+        beforeEach(() => {
+            optionsPreset1 = Object.assign({}, DEFAULT_PRESET, {
                 compact: false,
                 rotateUnicodeArray: true,
                 unicodeArray: false,
                 unicodeArrayThreshold: 0.5,
                 wrapUnicodeArrayCalls: true
-
-            }),
-            optionsPreset2: IOptionsPreset = Object.assign({}, DEFAULT_PRESET, {
+            });
+            optionsPreset2 = Object.assign({}, DEFAULT_PRESET, {
                 unicodeArrayThreshold: 2
-
             });
+        });
 
         it('should normalize options preset', () => {
             assert.deepEqual(