diff --git a/test/NodeUtils.spec.ts b/test/NodeUtils.spec.ts new file mode 100644 index 00000000..92f4783a --- /dev/null +++ b/test/NodeUtils.spec.ts @@ -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'` + }); + }); + }); +}); \ No newline at end of file