Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('regards CDATA childnodes as text nodes', () => {
const document = new slimdom.Document();
var element = document.appendChild(document.createElement('test'));
element.appendChild(document.createTextNode('Some '));
element.appendChild(document.createCDATASection(''));
chai.assert.equal(evaluateXPathToString('string()', document), 'Some ');
});
it('regards CDATA nodes as text nodes', () => {
const document = new slimdom.Document();
var element = document.appendChild(document.createElement('test'));
element.appendChild(document.createTextNode('Some '));
element.appendChild(document.createCDATASection(''));
chai.assert.equal(
evaluateXPathToString('string()', document.documentElement),
'Some '
);
});
import chai from 'chai';
import { getBucketsForNode } from 'fontoxpath';
import * as slimdom from 'slimdom';
const doc = new slimdom.Document();
describe('getBucketsForNode', () => {
it('returns the correct buckets for elements', () => {
chai.assert.deepEqual(getBucketsForNode(doc.createElement('element')), ['type-1', 'name-element']);
});
it('returns the correct buckets for text nodes', () => {
chai.assert.deepEqual(getBucketsForNode(doc.createTextNode('A piece of text')), ['type-3']);
});
});
import * as chai from 'chai';
import { getBucketsForNode } from 'fontoxpath';
import * as slimdom from 'slimdom';
const doc = new slimdom.Document();
describe('getBucketsForNode', () => {
it('returns the correct buckets for elements', () => {
chai.assert.deepEqual(getBucketsForNode(doc.createElement('element')), [
'type-1',
'name-element'
]);
});
it('returns the correct buckets for text nodes', () => {
chai.assert.deepEqual(getBucketsForNode(doc.createTextNode('A piece of text')), ['type-3']);
});
});
it('can optimize an and expression with buckets', () => {
chai.assert.isFalse(evaluateXPathToBoolean('self::p and true()', new slimdom.Document()));
});
it('can optimize an and expression with buckets', () => {
chai.assert.isFalse(evaluateXPathToBoolean('self::p and true()', new slimdom.Document()));
});
beforeEach(() => {
documentNode = new slimdom.Document();
});
beforeEach(() => {
documentNode = new slimdom.Document();
});
beforeEach(() => {
documentNode = new slimdom.Document();
});
beforeEach(() => {
documentNode = new slimdom.Document();
});