Skip to content

Commit 3647ed1

Browse files
committed
add a test
1 parent 4f21383 commit 3647ed1

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.log
22
node_modules
33
dist
4+
.next
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import React from 'react'
2+
3+
export default () => <h1>My component!</h1>

test/index.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import test from 'ava'
2+
import { resolve } from 'path'
3+
import build from '../server/build'
4+
import { render as _render } from '../server/render'
5+
6+
const dir = resolve(__dirname, 'fixtures', 'basic')
7+
8+
test.before(() => build(dir))
9+
10+
test(async (t) => {
11+
const html = await render('/stateless')
12+
console.log(html)
13+
t.true(html.includes('<h1>My component!</h1>'))
14+
})
15+
16+
function render (url, ctx) {
17+
return _render(url, ctx, { dir, staticMarkup: true })
18+
}

0 commit comments

Comments
 (0)