mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
NodeUtils tests
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { NodeType } from "../src/enums/NodeType";
|
||||
|
||||
import { NodeUtils } from '../src/NodeUtils';
|
||||
|
||||
let assert: any = require('chai').assert;
|
||||
|
||||
describe('NodeUtils', () => {
|
||||
describe('addXVerbatimPropertyToLiterals (node: INode): void', () => {
|
||||
let node: any;
|
||||
|
||||
beforeEach(() => {
|
||||
node = {
|
||||
type: NodeType.Literal,
|
||||
value: 'string',
|
||||
raw: `'string'`
|
||||
};
|
||||
|
||||
NodeUtils.addXVerbatimPropertyToLiterals(node)
|
||||
});
|
||||
|
||||
it('should add `x-verbatim-property` to `Literal` node', () => {
|
||||
assert.deepEqual(node, {
|
||||
type: NodeType.Literal,
|
||||
value: 'string',
|
||||
raw: `'string'`,
|
||||
'x-verbatim-property': `'string'`
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user