UNPKG

fontoxpath

Version:

A minimalistic XPath 3.1 engine in JavaScript

12 lines (11 loc) 483 B
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']); }); });