mirror of
https://github.com/tenrok/BBob.git
synced 2026-05-15 11:59:37 +03:00
29f909a589
* 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
36 lines
666 B
TypeScript
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']);
|
|
});
|
|
});
|