@@ -5,15 +5,15 @@ const path = require('path')
55const { expect } = require ( 'chai' )
66const {
77 genId,
8- test ,
8+ mockBundleAndRun ,
99 mockRender
1010} = require ( './shared' )
1111
1212const normalizeNewline = require ( 'normalize-newline' )
1313
1414describe ( 'style block features' , ( ) => {
1515 it ( 'scoped style' , done => {
16- test ( {
16+ mockBundleAndRun ( {
1717 entry : 'scoped-css.vue'
1818 } , ( window , module ) => {
1919 const id = 'data-v-' + genId ( 'scoped-css.vue' )
@@ -58,7 +58,7 @@ describe('style block features', () => {
5858 } )
5959
6060 it ( 'media-query' , done => {
61- test ( {
61+ mockBundleAndRun ( {
6262 entry : 'media-query.vue'
6363 } , ( window ) => {
6464 let style = window . document . querySelector ( 'style' ) . textContent
@@ -70,7 +70,7 @@ describe('style block features', () => {
7070 } )
7171
7272 it ( 'supports-query' , done => {
73- test ( {
73+ mockBundleAndRun ( {
7474 entry : 'supports-query.vue'
7575 } , ( window ) => {
7676 let style = window . document . querySelector ( 'style' ) . textContent
@@ -82,7 +82,7 @@ describe('style block features', () => {
8282 } )
8383
8484 it ( 'postcss options' , done => {
85- test ( {
85+ mockBundleAndRun ( {
8686 entry : 'postcss.vue' ,
8787 vue : {
8888 postcss : {
@@ -101,7 +101,7 @@ describe('style block features', () => {
101101
102102 it ( 'load postcss config file' , done => {
103103 fs . writeFileSync ( '.postcssrc' , JSON . stringify ( { parser : 'sugarss' } ) )
104- test ( {
104+ mockBundleAndRun ( {
105105 entry : 'postcss.vue'
106106 } , ( window ) => {
107107 let style = window . document . querySelector ( 'style' ) . textContent
@@ -114,7 +114,7 @@ describe('style block features', () => {
114114
115115 it ( 'load cascading postcss config file' , done => {
116116 fs . writeFileSync ( '.postcssrc' , JSON . stringify ( { parser : 'sugarss' } ) )
117- test ( {
117+ mockBundleAndRun ( {
118118 entry : 'sub/postcss-cascade.vue' ,
119119 vue : { postcss : { cascade : true } }
120120 } , ( window ) => {
@@ -128,7 +128,7 @@ describe('style block features', () => {
128128
129129 it ( 'load postcss config file by path' , done => {
130130 fs . writeFileSync ( 'test/.postcssrc' , JSON . stringify ( { parser : 'sugarss' } ) )
131- test ( {
131+ mockBundleAndRun ( {
132132 entry : 'postcss.vue' ,
133133 vue : {
134134 postcss : {
@@ -148,7 +148,7 @@ describe('style block features', () => {
148148
149149 it ( 'load postcss config file with js syntax error' , done => {
150150 fs . writeFileSync ( '.postcssrc.js' , 'module.exports = { hello }' )
151- test ( {
151+ mockBundleAndRun ( {
152152 entry : 'basic.vue'
153153 } , ( window , module , vueModule , instance , jsdomErr , webpackInfo ) => {
154154 const { stats : { compilation : { warnings, errors } } , err } = webpackInfo
@@ -163,7 +163,7 @@ describe('style block features', () => {
163163 } )
164164
165165 it ( 'postcss lang' , done => {
166- test ( {
166+ mockBundleAndRun ( {
167167 entry : 'postcss-lang.vue'
168168 } , ( window ) => {
169169 let style = window . document . querySelector ( 'style' ) . textContent
@@ -175,7 +175,7 @@ describe('style block features', () => {
175175
176176 it ( 'css-modules' , done => {
177177 function testWithIdent ( localIdentName , regexToMatch , cb ) {
178- test ( {
178+ mockBundleAndRun ( {
179179 entry : 'css-modules.vue' ,
180180 vue : {
181181 cssModules : localIdentName && {
0 commit comments