mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-14 18:42:24 +03:00
refactor(*): convert to babel and generation to lib, es, dist folders (#2)
* refactor(*): convert to babel and generation to lib, es, dist * chore(*): remove generated files * fix(*): lint run command
This commit is contained in:
committed by
GitHub
parent
d22a2895a4
commit
32a7fb51da
@@ -1,14 +1,20 @@
|
||||
const render = require('../lib/index');
|
||||
const parse = require('@bbob/parser');
|
||||
import {parse} from '@bbob/parser'
|
||||
import {render} from '../src';
|
||||
|
||||
const process = (input, params) => render(parse(input), params);
|
||||
const process = (input, params) => {
|
||||
const ast = parse(input);
|
||||
const html = render(ast, params);
|
||||
|
||||
return html
|
||||
};
|
||||
|
||||
describe('@bbob/html', () => {
|
||||
test('render bbcode tag with single param as html tag', () => {
|
||||
const input = '[url=https://ru.wikipedia.org]Text[/url]';
|
||||
const result = '<url url="https://ru.wikipedia.org">Text</url>';
|
||||
const expected = '<url url="https://ru.wikipedia.org">Text</url>';
|
||||
const result = process(input)
|
||||
|
||||
expect(process(input)).toBe(result);
|
||||
expect(result).toBe(expected);
|
||||
});
|
||||
|
||||
test('render bbcode tag with multiple params as html tag', () => {
|
||||
|
||||
Reference in New Issue
Block a user