test: inline postcss config

This commit is contained in:
Clark Du 2017-11-21 15:38:12 +08:00 committed by Pooya Parsa
parent 162b56ee4e
commit 9bf73b0b5a
3 changed files with 16 additions and 1 deletions

View File

@ -43,6 +43,12 @@ test('/css', async t => {
t.is(window.getComputedStyle(element).color, 'red')
})
test('/postcss', async t => {
const window = await nuxt.renderAndGetWindow(url('/css'))
const element = window.document.querySelector('div.red')
t.is(window.getComputedStyle(element)['background-color'], 'blue')
})
test('/stateful', async t => {
const { html } = await nuxt.renderRoute('/stateful')
t.true(html.includes('<div><p>The answer is 42</p></div>'))

View File

@ -15,5 +15,10 @@ module.exports = {
bad: null,
'': true
},
transition: false
transition: false,
build: {
postcss: [
require('postcss-cssnext')()
]
}
}

View File

@ -3,6 +3,10 @@
</template>
<style>
@custom-selector :--red div.red;
:--red {
background-color: blue;
}
.red {
color: red;
}