NodeUtils tests

This commit is contained in:
sanex3339
2016-06-16 16:44:12 +03:00
parent 3cb0a815af
commit 4b9b9dde93
+30
View File
@@ -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'`
});
});
});
});