2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-05-15 11:59:37 +03:00
Files
bbob/packages/bbob-parser/test/NodeList.test.ts
T
Nikolay Kost 29f909a589 fix(296): parse with lost repeated closing tag (#297)
* fix: extract node list ot separate file, fix nested parsing

* chore:  node list tests

* fix: nested tags parsing

* chore: changeset

* chore: remove unused files

* chore: disable publish on every commit
2025-10-14 04:11:19 +02:00

36 lines
666 B
TypeScript

import { NodeList } from '../src/NodeList';
describe('NodeList', () => {
test('push', () => {
const list = new NodeList();
list.push('a');
list.push('b');
list.push('c');
expect(list.ref()).toEqual(['a', 'b', 'c']);
});
test('last', () => {
const list = new NodeList();
list.push('a');
list.push('b');
list.push('c');
expect(list.last()).toBe('c');
expect(list.ref()).toEqual(['a', 'b', 'c']);
});
test('flush', () => {
const list = new NodeList();
list.push('a');
list.push('b');
list.push('c');
expect(list.flush()).toBe('c');
expect(list.ref()).toEqual(['a', 'b']);
});
});