mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import 'reflect-metadata';
|
|
|
|
import { assert } from 'chai';
|
|
|
|
import { SourceCode } from '../../../src/source-code/SourceCode';
|
|
|
|
describe('SourceCode', () => {
|
|
describe('getSourceCode', () => {
|
|
describe('should return source code', () => {
|
|
const expectedSourceCode: string = 'var test = 1;';
|
|
|
|
let sourceCode: string;
|
|
|
|
before(() => {
|
|
sourceCode = new SourceCode(expectedSourceCode, 'test').getSourceCode();
|
|
});
|
|
|
|
it('should return source code', () => {
|
|
assert.equal(sourceCode, expectedSourceCode);
|
|
});
|
|
});
|
|
});
|
|
|
|
describe('getSourceMap', () => {
|
|
describe('should return source map', () => {
|
|
const expectedSourceMap: string = 'test';
|
|
|
|
let sourceMap: string;
|
|
|
|
before(() => {
|
|
sourceMap = new SourceCode('var test = 1;', expectedSourceMap).getSourceMap();
|
|
});
|
|
|
|
it('should return source map', () => {
|
|
assert.equal(sourceMap, expectedSourceMap);
|
|
});
|
|
});
|
|
});
|
|
});
|