mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
CLI class refactoring
WIP tests for CLI class
This commit is contained in:
@@ -1,13 +1,26 @@
|
||||
import * as fs from 'fs';
|
||||
|
||||
import { JavaScriptObfuscatorCLI } from "../src/cli/JavaScriptObfuscatorCLI";
|
||||
|
||||
let assert: any = require('chai').assert;
|
||||
|
||||
describe('JavaScriptObfuscatorCLI', () => {
|
||||
let CLI: JavaScriptObfuscatorCLI,
|
||||
fixturesDirName: string = 'test/fixtures',
|
||||
tmpDirName: string = 'test/tmp',
|
||||
fixtureFileName: string = 'sample.js',
|
||||
fixtureFilePath: string = `${fixturesDirName}/${fixtureFileName}`,
|
||||
outputFileName: string = 'sample-obfuscated.js',
|
||||
outputFilePath: string = `${tmpDirName}/${outputFileName}`;
|
||||
|
||||
describe('run (): void', () => {
|
||||
it('should obfuscate file with JS code', () => {
|
||||
let CLI: JavaScriptObfuscatorCLI = new JavaScriptObfuscatorCLI([
|
||||
beforeEach(() => {
|
||||
CLI = new JavaScriptObfuscatorCLI([
|
||||
'node',
|
||||
'javascript-obfuscator',
|
||||
fixtureFilePath,
|
||||
'--output',
|
||||
outputFilePath,
|
||||
'--compact',
|
||||
'false',
|
||||
'--selfDefending',
|
||||
@@ -15,8 +28,15 @@ describe('JavaScriptObfuscatorCLI', () => {
|
||||
]);
|
||||
|
||||
CLI.run();
|
||||
});
|
||||
|
||||
it('should obfuscate file with JS code', () => {
|
||||
assert.equal(1, 1);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fs.unlinkSync(outputFilePath);
|
||||
fs.rmdirSync(tmpDirName);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user