From 802778a54b04c140f67a122edfe17e7bf9870e4b Mon Sep 17 00:00:00 2001 From: James Homer Date: Thu, 26 Oct 2017 14:34:31 +0100 Subject: [PATCH] Modify /head test to fail with function based titleTemplate --- test/basic.test.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/basic.test.js b/test/basic.test.js index a35c7bf893..9c7d561a4e 100755 --- a/test/basic.test.js +++ b/test/basic.test.js @@ -13,7 +13,11 @@ let nuxt = null test.before('Init Nuxt.js', async t => { const options = { rootDir: resolve(__dirname, 'fixtures/basic'), - dev: false + dev: false, + head: { + titleTemplate: titleChunk => titleChunk ? `${titleChunk} - Nuxt.js` : 'Nuxt.js' + // titleTemplate: '%s - Nuxt.js' + } } nuxt = new Nuxt(options) await new Builder(nuxt).build() @@ -53,7 +57,7 @@ test('/head', async t => { const window = await nuxt.renderAndGetWindow(url('/head'), { virtualConsole: false }) const html = window.document.body.innerHTML const metas = window.document.getElementsByTagName('meta') - t.is(window.document.title, 'My title') + t.is(window.document.title, 'My title - Nuxt.js') t.is(metas[0].getAttribute('content'), 'my meta') t.true(html.includes('

I can haz meta tags

')) })