Browse Source

Merge pull request #582 from javascript-obfuscator/commander-version-update

Commander version update
Timofey Kachalov 5 năm trước cách đây
mục cha
commit
5eb2f743d0
7 tập tin đã thay đổi với 395 bổ sung167 xóa
  1. 4 0
      CHANGELOG.md
  2. 0 0
      dist/index.browser.js
  3. 0 0
      dist/index.cli.js
  4. 0 0
      dist/index.js
  5. 2 2
      package.json
  6. 48 2
      test/functional-tests/cli/JavaScriptObfuscatorCLI.spec.ts
  7. 341 163
      yarn.lock

+ 4 - 0
CHANGELOG.md

@@ -1,5 +1,9 @@
 Change Log
 
+v0.27.1
+---
+* Dependencies update, fixed https://www.npmjs.com/advisories/1488
+
 v0.27.0
 ---
 * **Feature:** new method `obfuscateMultiple` to obfuscation of multiple source codes

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/index.browser.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/index.cli.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
dist/index.js


+ 2 - 2
package.json

@@ -1,6 +1,6 @@
 {
   "name": "javascript-obfuscator",
-  "version": "0.27.0",
+  "version": "0.27.1",
   "description": "JavaScript obfuscator",
   "keywords": [
     "obfuscator",
@@ -28,7 +28,7 @@
     "chalk": "3.0.0",
     "chance": "1.1.4",
     "class-validator": "0.11.0",
-    "commander": "4.1.1",
+    "commander": "5.0.0",
     "escodegen": "1.14.1",
     "eslint-scope": "5.0.0",
     "estraverse": "4.3.0",

+ 48 - 2
test/functional-tests/cli/JavaScriptObfuscatorCLI.spec.ts

@@ -713,14 +713,59 @@ describe('JavaScriptObfuscatorCLI', function (): void {
 
         describe('help output', () => {
             let callback: sinon.SinonSpy<any, void>,
-                stdoutWriteMock: StdoutWriteMock;
+                stdoutWriteMock: StdoutWriteMock,
+                stubExit: sinon.SinonStub;
 
             beforeEach(() => {
+                stubExit = sinon.stub(process, 'exit');
                 callback = sinon.spy(console, 'log');
                 stdoutWriteMock = new StdoutWriteMock(process.stdout.write);
             });
 
-            describe('`--help` option is set', () => {
+            describe('`--help` option is set without any additional parameters', () => {
+                let isConsoleLogCalled: boolean;
+
+                beforeEach(() => {
+                    stdoutWriteMock.mute();
+
+                    JavaScriptObfuscatorCLI.obfuscate([
+                        'node',
+                        'javascript-obfuscator',
+                        '--help'
+                    ]);
+
+                    stdoutWriteMock.restore();
+                    isConsoleLogCalled = callback.called;
+                });
+
+                it('should print `console.log` help', () => {
+                    assert.equal(isConsoleLogCalled, true);
+                });
+            });
+
+            describe('`--help` option is set before file path', () => {
+                let isConsoleLogCalled: boolean;
+
+                beforeEach(() => {
+                    stdoutWriteMock.mute();
+
+                    JavaScriptObfuscatorCLI.obfuscate([
+                        'node',
+                        'javascript-obfuscator',
+                        '--help',
+                        fixtureFilePath
+                    ]);
+
+                    stdoutWriteMock.restore();
+                    isConsoleLogCalled = callback.called;
+                });
+
+                it('should print `console.log` help', () => {
+                    assert.equal(isConsoleLogCalled, true);
+                });
+            });
+
+            describe('`--help` option is set after file path', () => {
                 let isConsoleLogCalled: boolean;
 
                 beforeEach(() => {
@@ -763,6 +808,7 @@ describe('JavaScriptObfuscatorCLI', function (): void {
             });
 
             afterEach(() => {
+                stubExit.restore();
                 callback.restore();
             });
         });

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 341 - 163
yarn.lock


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác