2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-05-15 11:59:37 +03:00

test(parser): add posthtml integration test

This commit is contained in:
Nikolay Kostyurin
2018-07-30 22:49:55 +02:00
parent ebba9bcfc9
commit fdc05c0618
2 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
# @bbob/parser
[![install size](https://packagephobia.now.sh/badge?p=@bbob/parser)](https://packagephobia.now.sh/result?p=@bbob/parser) [![Known Vulnerabilities](https://snyk.io/test/github/JiLiZART/bbob/badge.svg?targetFile=packages%2Fbbob-parser%2Fpackage.json)](https://snyk.io/test/github/JiLiZART/bbob?targetFile=packages%2Fbbob-parser%2Fpackage.json)
Parses BBCode and returns AST Tree
> Parses BBCode and returns array AST tree
Valid for use with [posthtml-render](https://github.com/posthtml/posthtml-render)
@@ -0,0 +1,13 @@
const render = require('posthtml-render');
const parse = require('../lib');
describe('posthtml-render', () => {
it('render AST to html', () => {
const ast = parse('[size=150][b]PostHTML render test[/b][/size]');
const html = render(ast);
expect(html).toBe('<size size="150"><b>PostHTML render test</b></size>')
})
});