mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-11 18:02:26 +03:00
cbccbaf896
* chore: initial setup for vue2 packages * feat: basic Vue 2 Component * feat(vue2): add more test cases * test(preset): add more cases to test in preset * test(preset-vue2): add more cases to test tags processing * fix(preset): tag node checking * test(preset-vue): more coverage for vue preset * refactor(vue2): move default export to plugin install func * feat(example-vue2): add vue2 example to examples folder * chore(example-vue2): remove unused npm scripts * chore: add vue 2 example in main README * chore: update package.json descriptions
24 lines
649 B
JavaScript
24 lines
649 B
JavaScript
import preset, { createTags, tagAttr } from '../src'
|
|
|
|
describe('@bbob/preset-vue', () => {
|
|
test('is a function', () => {
|
|
expect(preset).toBeInstanceOf(Function)
|
|
})
|
|
|
|
test('createTags', () => {
|
|
const defFn = jest.fn(() => ({}))
|
|
const defTags = {
|
|
b: defFn,
|
|
i: defFn,
|
|
u: defFn,
|
|
s: defFn,
|
|
}
|
|
const tags = createTags(defTags)
|
|
|
|
expect(tags.b()).toEqual(tagAttr({ fontWeight: 'bold' }))
|
|
expect(tags.i()).toEqual(tagAttr({ fontStyle: 'italic' }))
|
|
expect(tags.u()).toEqual(tagAttr({ textDecoration: 'underline' }))
|
|
expect(tags.s()).toEqual(tagAttr({ textDecoration: 'line-through' }))
|
|
})
|
|
});
|