it's alive
This commit is contained in:
parent
e413fc1ff6
commit
859ed7402a
|
|
@ -1,5 +1,4 @@
|
||||||
import { expect, describe, test, beforeEach } from 'bun:test'
|
import { expect, describe, test, beforeEach } from 'bun:test'
|
||||||
import { type Value } from 'reefvm'
|
|
||||||
|
|
||||||
const buffer: string[] = []
|
const buffer: string[] = []
|
||||||
|
|
||||||
|
|
@ -8,8 +7,8 @@ const ribbitGlobals = {
|
||||||
await cb()
|
await cb()
|
||||||
return buffer.join("\n")
|
return buffer.join("\n")
|
||||||
},
|
},
|
||||||
tag: (tagName: string, atDefaults = {}) => {
|
tag: async (tagFn: Function, atDefaults = {}) => {
|
||||||
return (atNamed = {}, ...args: any[]) => tag(tagName, Object.assign({}, atDefaults, atNamed), ...args)
|
return (atNamed = {}, ...args: any[]) => tagFn(Object.assign({}, atDefaults, atNamed), ...args)
|
||||||
},
|
},
|
||||||
head: (atNamed: {}, ...args: any[]) => tag('head', atNamed, ...args),
|
head: (atNamed: {}, ...args: any[]) => tag('head', atNamed, ...args),
|
||||||
title: (atNamed: {}, ...args: any[]) => tag('title', atNamed, ...args),
|
title: (atNamed: {}, ...args: any[]) => tag('title', atNamed, ...args),
|
||||||
|
|
@ -81,7 +80,7 @@ end
|
||||||
|
|
||||||
test('custom tags', () => {
|
test('custom tags', () => {
|
||||||
expect(`
|
expect(`
|
||||||
list = tag 'ul' class=list
|
list = tag ul class=list
|
||||||
ribbit:
|
ribbit:
|
||||||
list:
|
list:
|
||||||
li border-bottom='1px solid black' one
|
li border-bottom='1px solid black' one
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user