mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-17 19:21:20 +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,10 +1,13 @@
|
||||
const core = require('../lib');
|
||||
import render from '@bbob/html'
|
||||
import core from '../src'
|
||||
|
||||
const stringify = val => JSON.stringify(val);
|
||||
|
||||
const process = (plugins, input) => core(plugins).process(input, { render });
|
||||
|
||||
describe('@bbob/core', () => {
|
||||
test('parse bbcode string to ast and html', () => {
|
||||
const res = core().process('[style size="15px"]Large Text[/style]');
|
||||
const res = process([], '[style size="15px"]Large Text[/style]');
|
||||
const ast = res.tree;
|
||||
|
||||
expect(res.html).toBe(`<style size="15px">Large Text</style>`);
|
||||
@@ -31,7 +34,7 @@ describe('@bbob/core', () => {
|
||||
return node
|
||||
});
|
||||
|
||||
const res = core([testPlugin()]).process('[mytag size="15px"]Large Text[/mytag]');
|
||||
const res = process([testPlugin()], '[mytag size="15px"]Large Text[/mytag]');
|
||||
const ast = res.tree;
|
||||
|
||||
expect(ast).toBeInstanceOf(Array);
|
||||
@@ -61,7 +64,7 @@ describe('@bbob/core', () => {
|
||||
return node
|
||||
});
|
||||
|
||||
const res = core([testPlugin()]).process(`[mytag1 size="15"]Tag1[/mytag1][mytag2 size="16"]Tag2[/mytag2][mytag3]Tag3[/mytag3]`);
|
||||
const res = process([testPlugin()], `[mytag1 size="15"]Tag1[/mytag1][mytag2 size="16"]Tag2[/mytag2][mytag3]Tag3[/mytag3]`);
|
||||
const ast = res.tree;
|
||||
|
||||
expect(ast).toBeInstanceOf(Array);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { iterate } = require('../lib/utils');
|
||||
import { iterate } from '../src/utils';
|
||||
|
||||
describe('@bbob/core utils', () => {
|
||||
test('iterate', () => {
|
||||
|
||||
Reference in New Issue
Block a user