Skip to content

Commit 9438408

Browse files
committed
fix SSR tests after preserveWhitespace removal
1 parent 13d64d2 commit 9438408

File tree

2 files changed

+26
-30
lines changed

2 files changed

+26
-30
lines changed

test/ssr/ssr-stream.spec.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ describe('SSR: renderToStream', () => {
5353
stream.on('end', () => {
5454
expect(res).toContain(
5555
'<div server-rendered="true">' +
56-
'<p class="hi">yoyo</p>' +
57-
'<div id="ho" class="a red"></div>' +
58-
'<span>hi</span>' +
59-
'<input value="hi">' +
60-
'<div class="b">test</div>' +
61-
'<div class="b">test</div>' +
56+
'<p class="hi">yoyo</p> ' +
57+
'<div id="ho" class="a red"></div> ' +
58+
'<span>hi</span> ' +
59+
'<input value="hi"> ' +
60+
'<div class="b">test</div> ' +
61+
'<div class="b">test</div>' +
6262
'</div>'
6363
)
6464
done()
@@ -80,9 +80,7 @@ describe('SSR: renderToStream', () => {
8080
})
8181

8282
function renderVmWithOptions (options) {
83-
const res = compileToFunctions(options.template, {
84-
preserveWhitespace: false
85-
})
83+
const res = compileToFunctions(options.template)
8684
Object.assign(options, res)
8785
delete options.template
8886
return renderToStream(new Vue(options))

test/ssr/ssr-string.spec.js

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,12 @@ describe('SSR: renderToString', () => {
258258
}, result => {
259259
expect(result).toContain(
260260
'<div server-rendered="true">' +
261-
'<p class="hi">yoyo</p>' +
262-
'<div id="ho" class="red"></div>' +
263-
'<span>hi</span>' +
264-
'<input value="hi">' +
265-
'<img src="https://vuejs.org/images/logo.png">' +
266-
'<div class="a">test</div>' +
261+
'<p class="hi">yoyo</p> ' +
262+
'<div id="ho" class="red"></div> ' +
263+
'<span>hi</span> ' +
264+
'<input value="hi"> ' +
265+
'<img src="https://vuejs.org/images/logo.png"> ' +
266+
'<div class="a">test</div> ' +
267267
'<span class="b">testAsync</span>' +
268268
'</div>'
269269
)
@@ -285,10 +285,10 @@ describe('SSR: renderToString', () => {
285285
}, result => {
286286
expect(result).toContain(
287287
'<div server-rendered="true">' +
288-
'<span test="ok">hello</span>' +
289-
'<span>hello</span>' +
290-
'<span>hello</span>' +
291-
'<span test="true">hello</span>' +
288+
'<span test="ok">hello</span> ' +
289+
'<span>hello</span> ' +
290+
'<span>hello</span> ' +
291+
'<span test="true">hello</span> ' +
292292
'<span test="0">hello</span>' +
293293
'</div>'
294294
)
@@ -311,11 +311,11 @@ describe('SSR: renderToString', () => {
311311
}, result => {
312312
expect(result).toContain(
313313
'<div server-rendered="true">' +
314-
'<span draggable="true">hello</span>' +
315-
'<span draggable="true">hello</span>' +
316-
'<span draggable="false">hello</span>' +
317-
'<span draggable="false">hello</span>' +
318-
'<span draggable="true">hello</span>' +
314+
'<span draggable="true">hello</span> ' +
315+
'<span draggable="true">hello</span> ' +
316+
'<span draggable="false">hello</span> ' +
317+
'<span draggable="false">hello</span> ' +
318+
'<span draggable="true">hello</span> ' +
319319
'<span draggable="false">hello</span>' +
320320
'</div>'
321321
)
@@ -336,9 +336,9 @@ describe('SSR: renderToString', () => {
336336
}, result => {
337337
expect(result).toContain(
338338
'<div server-rendered="true">' +
339-
'<span disabled="disabled">hello</span>' +
340-
'<span disabled="disabled">hello</span>' +
341-
'<span>hello</span>' +
339+
'<span disabled="disabled">hello</span> ' +
340+
'<span disabled="disabled">hello</span> ' +
341+
'<span>hello</span> ' +
342342
'<span disabled="disabled">hello</span>' +
343343
'</div>'
344344
)
@@ -403,9 +403,7 @@ describe('SSR: renderToString', () => {
403403
})
404404

405405
function renderVmWithOptions (options, cb) {
406-
const res = compileToFunctions(options.template, {
407-
preserveWhitespace: false
408-
})
406+
const res = compileToFunctions(options.template)
409407
Object.assign(options, res)
410408
delete options.template
411409
renderToString(new Vue(options), (err, res) => {

0 commit comments

Comments
 (0)