From 9bf73b0b5a4d254d710d8e10bf57b177bee09655 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Tue, 21 Nov 2017 15:38:12 +0800 Subject: [PATCH] test: inline postcss config --- test/basic.ssr.test.js | 6 ++++++ test/fixtures/basic/nuxt.config.js | 7 ++++++- test/fixtures/basic/pages/css.vue | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/test/basic.ssr.test.js b/test/basic.ssr.test.js index 9b9a4d62a8..e3dc4559b2 100755 --- a/test/basic.ssr.test.js +++ b/test/basic.ssr.test.js @@ -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('

The answer is 42

')) diff --git a/test/fixtures/basic/nuxt.config.js b/test/fixtures/basic/nuxt.config.js index e291976a5c..6d0b354c14 100644 --- a/test/fixtures/basic/nuxt.config.js +++ b/test/fixtures/basic/nuxt.config.js @@ -15,5 +15,10 @@ module.exports = { bad: null, '': true }, - transition: false + transition: false, + build: { + postcss: [ + require('postcss-cssnext')() + ] + } } diff --git a/test/fixtures/basic/pages/css.vue b/test/fixtures/basic/pages/css.vue index 902c7a07f2..08eca4556c 100755 --- a/test/fixtures/basic/pages/css.vue +++ b/test/fixtures/basic/pages/css.vue @@ -3,6 +3,10 @@