123456789101112131415161718192021222324252627 |
- import { assert } from 'chai';
- import { IObfuscationResult } from '../../../../src/interfaces/IObfuscationResult';
- import { NO_CUSTOM_NODES_PRESET } from '../../../../src/options/presets/NoCustomNodes';
- import { readFileAsString } from '../../../helpers/readFileAsString';
- import { JavaScriptObfuscator } from '../../../../src/JavaScriptObfuscator';
- describe('StringArrayCallsWrapper', () => {
- it('should correctly append `StringArrayCallsWrapper` custom node into the obfuscated code', () => {
- let obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
- readFileAsString(__dirname + '/fixtures/simple-input.js'),
- {
- ...NO_CUSTOM_NODES_PRESET,
- stringArray: true,
- stringArrayThreshold: 1
- }
- );
- assert.match(
- obfuscationResult.getObfuscatedCode(),
- /_0x([a-f0-9]){4,6} *= *_0x([a-f0-9]){4,6} *- *0x0\;/
- );
- });
- });
|