2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-05-24 14:04:06 +03:00
Files
Nikolay Kostyurin da6709d437 feat: update core deps (#120)
* feat: use swc.rs instead of babel

* BREAKING CHANGE: now we use swc.rs as main bundler and transpiler instead of babel
  - jest now uses swc
  - rollup now uses swc

* feat: benchmark now separate package with `npm start` and colored output
  - benchmark as separate package with error throw if package drops performance

* feat: all lerna packages now using scripts/pkg-task

* feat(github): publish to npm and github registry
  - when release was created this action automaticly publish packages to npm and github

* feat(github): move all from Travis CI to Github Actions
  - code analysis and tests now using github actions

* test: increase tests coverage
  - add more tests for @bbob/react, @bbob/vue2 and @bbob/parser
2021-11-29 00:33:06 +02:00

39 lines
980 B
JavaScript

import { render } from "../src";
describe('@bbob/vue2 render', () => {
const createElement = (tagName, props, children) => {
return { tagName, props, children }
}
test('render simple b tag', () => {
const html = render(createElement, '[b]bolded text[/b]');
expect(html).toStrictEqual([
{
"children": ["bolded", " ", "text"],
"props": { "class": undefined, "domProps": {}, "key": 0, "style": undefined },
"tagName": "b"
}
])
})
test('render self closed b tag', () => {
const html = render(createElement, '[b][/b]');
expect(html).toStrictEqual([
{
"children": null,
"props": { "class": undefined, "domProps": {}, "key": 0, "style": undefined },
"tagName": "b"
}
])
})
test('render simple text nodes', () => {
const html = render(createElement, 'some example words');
expect(html).toStrictEqual([
"some", " ", "example", " ", "words"
])
})
})