Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('returns no attributes for comments', () =>
chai.assert.equal(
evaluateXPathToString(
'attribute::someAttribute',
documentNode.createComment('some comment')
),
''
));
it('Returns a sequence containing the items in $arg in reverse order.', () =>
chai.assert.equal(
evaluateXPathToString('reverse(("1","2","3")) => string-join(",")', documentNode),
'3,2,1'
));
});
it('If $arg is an atomic value, the function returns the result of the expression $arg cast as xs:string (see 19 Casting).', () => {
chai.assert.equal(evaluateXPathToString('string(12)', documentNode), '12');
chai.assert.equal(evaluateXPathToString('string("13")', documentNode), '13');
chai.assert.equal(evaluateXPathToString('string(true())', documentNode), 'true');
chai.assert.equal(evaluateXPathToString('string(false())', documentNode), 'false');
});
it('If the value of $arg1 is the empty sequence, the zero length string is returned', () =>
chai.assert.equal(evaluateXPathToString('lower-case(())', documentNode), ''));
it('the registered function can be used in a xPath selector with return value gDay', () => {
chai.assert.equal(
evaluateXPathToString('test:custom-gDay-function()', documentNode),
'---22Z'
);
});
it('it returns the node name of the given context', () => {
jsonMlMapper.parse(['someElement', 'Some text.'], documentNode);
chai.assert.equal(
evaluateXPathToString('node-name(.)', documentNode.firstChild),
'someElement'
);
});
() => chai.assert.equal(evaluateXPathToString('let $fn := concat#3 return $fn("abc", "def", "ghi")', documentNode), 'abcdefghi'));
() => chai.assert.equal(evaluateXPathToString('timezone-from-dateTime(xs:dateTime("2000-10-11T12:13:10.1+05:00")) => string()', documentNode), 'PT5H'));
});
.filter(testSetNode => shouldRunTestByName[evaluateXPathToString('@name', testSetNode)])
.map(testSetNode => evaluateXPathToString('@file', testSetNode))
(varsByName, variable) =>
Object.assign(varsByName, {
[evaluateXPathToString('@role', variable).substr(1)]: getFile(
(cwd ? cwd + '/' : '') + evaluateXPathToString('@file', variable)
)
}),
{}