This commit is contained in:
sanex3339
2016-06-24 18:29:46 +03:00
parent dcc7546557
commit 90d8933ecb
8 changed files with 179 additions and 71 deletions
+27 -3
View File
@@ -1,11 +1,35 @@
import { JavaScriptObfuscatorCLI } from "../src/cli/JavaScriptObfuscatorCLI";
let assert: any = require('chai').assert;
let assert: any = require('chai').assert,
stream: any = require("mock-utf8-stream"),
mockStdin: any = require('mock-stdin');
describe('JavaScriptObfuscatorCLI', () => {
describe('obfuscate (sourceCode: string, customOptions?: IOptionsPreset): string', () => {
it('should ', () => {
describe('run (): void', () => {
it('should obfuscate file with JS code', function (done: MochaDone): void {
let stdin: any = mockStdin.stdin(),
stdout: any = new stream.MockWritableStream();
this.timeout(7000);
stdout.captureData();
let CLI: JavaScriptObfuscatorCLI = new JavaScriptObfuscatorCLI(
[
'node',
'javascript-obfuscator',
'--compact',
'false',
'--selfDefending',
'false'
],
stdin.send(new Buffer('var test = \'abc\';')),
stdout
);
CLI.run();
assert.equal(1, 1);
});
});
});