mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
19 lines
451 B
JavaScript
19 lines
451 B
JavaScript
![]() |
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')
|
||
|
console.log(html)
|
||
|
t.true(html.includes('<h1>My component!</h1>'))
|
||
|
})
|
||
|
|
||
|
function render (url, ctx) {
|
||
|
return _render(url, ctx, { dir, staticMarkup: true })
|
||
|
}
|