Files
javascript-obfuscator-javas…/test/unit-tests/source-code/SourceCode.spec.ts
T
2020-10-08 10:54:23 +03:00

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);
});
});
});
});