mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import { readFileAsString } from '../helpers/readFileAsString';
|
|
|
|
import { JavaScriptObfuscator } from '../../src/JavaScriptObfuscator';
|
|
|
|
const assert: Chai.AssertStatic = require('chai').assert;
|
|
|
|
describe('JavaScriptObfuscator performance', () => {
|
|
const iterationsCount: number = 500;
|
|
|
|
describe('performance: multiple calls', () => {
|
|
it('shows performance time with multiple obfuscator calls', function (): void {
|
|
this.timeout(10000);
|
|
|
|
for (let i: number = 0; i < iterationsCount; i++) {
|
|
JavaScriptObfuscator.obfuscate(readFileAsString('./test/fixtures/sample.js'));
|
|
}
|
|
|
|
assert.isOk(true);
|
|
});
|
|
});
|
|
|
|
describe('performance: large source code', () => {
|
|
it('shows performance time with large code size', function (): void {
|
|
this.timeout(5000);
|
|
|
|
JavaScriptObfuscator.obfuscate(readFileAsString('./test/fixtures/sample.js').repeat(iterationsCount));
|
|
|
|
assert.isOk(true);
|
|
});
|
|
});
|
|
});
|