Skip to content

Commit 11ea371

Browse files
yyx990803hefeng
authored and
hefeng
committed
test: e2e tests for basic renderer
1 parent d108689 commit 11ea371

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

test/e2e/specs/basic-ssr.html

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title></title>
6+
</head>
7+
<body>
8+
<script src="../../../dist/vue.min.js"></script>
9+
<script src="../../../packages/vue-server-renderer/basic.js"></script>
10+
11+
<div id="result">wtf</div>
12+
13+
<script>
14+
var vm = new Vue({
15+
data: { msg: 'foo' },
16+
template: '<div>{{ msg }}</div>'
17+
})
18+
19+
renderVueComponentToString(vm, function (err, result) {
20+
document.getElementById('result').textContent = err && err.toString() || result
21+
})
22+
</script>
23+
</body>
24+
</html>

test/e2e/specs/basic-ssr.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
'basic SSR': function (browser) {
3+
browser
4+
.url('http://localhost:8080/test/e2e/specs/basic-ssr.html')
5+
.assert.containsText('#result', '<div data-server-rendered="true">foo</div>')
6+
.end()
7+
}
8+
}

0 commit comments

Comments
 (0)