import test from 'ava'
import { resolve } from 'path'
import build from '../server/build'
import { render as _render } from '../server/render'
const dir = resolve(__dirname, 'fixtures', 'basic')
test.before(() => build(dir))
test(async t => {
const html = await render('/stateless')
t.true(html.includes('
My component!
'))
})
test(async t => {
const html = await render('/css')
t.true(html.includes(''))
t.true(html.includes('This is red
'))
})
test(async t => {
const html = await (render('/stateful'))
t.true(html.includes(''))
})
test(async t => {
const html = await (render('/head'))
t.true(html.includes(''))
t.true(html.includes('I can haz meta tags
'))
})
function render (url, ctx) {
return _render(url, ctx, { dir, staticMarkup: true })
}