mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
bin script refactoring
This commit is contained in:
@@ -1,35 +1,18 @@
|
||||
import * as child_process from 'child_process';
|
||||
|
||||
import { JavaScriptObfuscatorCLI } from "../src/cli/JavaScriptObfuscatorCLI";
|
||||
|
||||
let assert: any = require('chai').assert,
|
||||
stream: any = require("mock-utf8-stream"),
|
||||
mockStdin: any = require('mock-stdin');
|
||||
let assert: any = require('chai').assert;
|
||||
|
||||
describe('JavaScriptObfuscatorCLI', () => {
|
||||
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);
|
||||
|
||||
stdin.send('test/dev/test.js');
|
||||
|
||||
stdout.startCapture();
|
||||
|
||||
let CLI: JavaScriptObfuscatorCLI = new JavaScriptObfuscatorCLI(
|
||||
[
|
||||
'node',
|
||||
'javascript-obfuscator',
|
||||
'--compact',
|
||||
'false',
|
||||
'--selfDefending',
|
||||
'false'
|
||||
],
|
||||
stdin,
|
||||
stdout
|
||||
);
|
||||
it('should obfuscate file with JS code', () => {
|
||||
let CLI: JavaScriptObfuscatorCLI = new JavaScriptObfuscatorCLI([
|
||||
'node',
|
||||
'javascript-obfuscator',
|
||||
'--compact',
|
||||
'false',
|
||||
'--selfDefending',
|
||||
'false'
|
||||
]);
|
||||
|
||||
CLI.run();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user