test: custom postcss config

This commit is contained in:
Clark Du 2017-11-21 09:54:02 +08:00 committed by Pooya Parsa
parent 17caac59e2
commit 162b56ee4e
4 changed files with 29 additions and 0 deletions

View File

@ -19,6 +19,7 @@ module.exports = {
modulesDir: path.join(__dirname, '..', '..', '..', 'node_modules'),
transition: 'test',
layoutTransition: 'test',
loadingIndicator: 'circle',
offline: true,
plugins: [
'~/plugins/test.js',

View File

@ -4,3 +4,9 @@
<nuxt-link to="/about">About page</nuxt-link>
</div>
</template>
<style>
::placeholder {
color: black;
}
</style>

View File

@ -0,0 +1,17 @@
const path = require('path')
const modulesDir = path.join(__dirname, '..', '..', '..', 'node_modules')
const rootDir = __dirname
module.exports = {
plugins: {
'postcss-import': {
root: rootDir,
path: [
rootDir,
modulesDir
]
},
'postcss-url': {},
'postcss-cssnext': {}
}
}

View File

@ -44,6 +44,11 @@ test('/ (custom build.publicPath)', async t => {
t.true(html.includes('src="/test/orion/vendor.'))
})
test('/ (custom postcss.config.js)', async t => {
const { html } = await nuxt.renderRoute('/')
t.true(html.includes('::-webkit-input-placeholder'))
})
test('/test/ (router base)', async t => {
const window = await nuxt.renderAndGetWindow(url('/test/'))
const html = window.document.body.innerHTML