[tests] ensure global styles are inlined

This commit is contained in:
Pooya Parsa 2017-05-05 18:55:17 +04:30
parent 6504b0666a
commit 98ffc2110b
3 changed files with 12 additions and 1 deletions

3
test/fixtures/with-config/assets/app.css vendored Executable file
View File

@ -0,0 +1,3 @@
.global-css-selector {
color: red;
}

View File

@ -31,5 +31,8 @@ module.exports = {
extend (config, options) {
config.devtool = 'nosources-source-map'
}
}
},
css: [
{src: '~/assets/app.css'}
]
}

View File

@ -24,6 +24,11 @@ test('/', async t => {
t.true(html.includes('<h1>I have custom configurations</h1>'))
})
test('/ (global styles inlined)', async t => {
const { html } = await nuxt.renderRoute('/')
t.true(html.includes('.global-css-selector'))
})
test('/ (custom app.html)', async t => {
const { html } = await nuxt.renderRoute('/')
t.true(html.includes('<p>Made by Nuxt.js team</p>'))