@@ -5,15 +5,15 @@ const path = require('path')
5
5
const { expect } = require ( 'chai' )
6
6
const {
7
7
genId,
8
- test ,
8
+ mockBundleAndRun ,
9
9
mockRender
10
10
} = require ( './shared' )
11
11
12
12
const normalizeNewline = require ( 'normalize-newline' )
13
13
14
14
describe ( 'style block features' , ( ) => {
15
15
it ( 'scoped style' , done => {
16
- test ( {
16
+ mockBundleAndRun ( {
17
17
entry : 'scoped-css.vue'
18
18
} , ( window , module ) => {
19
19
const id = 'data-v-' + genId ( 'scoped-css.vue' )
@@ -58,7 +58,7 @@ describe('style block features', () => {
58
58
} )
59
59
60
60
it ( 'media-query' , done => {
61
- test ( {
61
+ mockBundleAndRun ( {
62
62
entry : 'media-query.vue'
63
63
} , ( window ) => {
64
64
let style = window . document . querySelector ( 'style' ) . textContent
@@ -70,7 +70,7 @@ describe('style block features', () => {
70
70
} )
71
71
72
72
it ( 'supports-query' , done => {
73
- test ( {
73
+ mockBundleAndRun ( {
74
74
entry : 'supports-query.vue'
75
75
} , ( window ) => {
76
76
let style = window . document . querySelector ( 'style' ) . textContent
@@ -82,7 +82,7 @@ describe('style block features', () => {
82
82
} )
83
83
84
84
it ( 'postcss options' , done => {
85
- test ( {
85
+ mockBundleAndRun ( {
86
86
entry : 'postcss.vue' ,
87
87
vue : {
88
88
postcss : {
@@ -101,7 +101,7 @@ describe('style block features', () => {
101
101
102
102
it ( 'load postcss config file' , done => {
103
103
fs . writeFileSync ( '.postcssrc' , JSON . stringify ( { parser : 'sugarss' } ) )
104
- test ( {
104
+ mockBundleAndRun ( {
105
105
entry : 'postcss.vue'
106
106
} , ( window ) => {
107
107
let style = window . document . querySelector ( 'style' ) . textContent
@@ -114,7 +114,7 @@ describe('style block features', () => {
114
114
115
115
it ( 'load cascading postcss config file' , done => {
116
116
fs . writeFileSync ( '.postcssrc' , JSON . stringify ( { parser : 'sugarss' } ) )
117
- test ( {
117
+ mockBundleAndRun ( {
118
118
entry : 'sub/postcss-cascade.vue' ,
119
119
vue : { postcss : { cascade : true } }
120
120
} , ( window ) => {
@@ -128,7 +128,7 @@ describe('style block features', () => {
128
128
129
129
it ( 'load postcss config file by path' , done => {
130
130
fs . writeFileSync ( 'test/.postcssrc' , JSON . stringify ( { parser : 'sugarss' } ) )
131
- test ( {
131
+ mockBundleAndRun ( {
132
132
entry : 'postcss.vue' ,
133
133
vue : {
134
134
postcss : {
@@ -148,7 +148,7 @@ describe('style block features', () => {
148
148
149
149
it ( 'load postcss config file with js syntax error' , done => {
150
150
fs . writeFileSync ( '.postcssrc.js' , 'module.exports = { hello }' )
151
- test ( {
151
+ mockBundleAndRun ( {
152
152
entry : 'basic.vue'
153
153
} , ( window , module , vueModule , instance , jsdomErr , webpackInfo ) => {
154
154
const { stats : { compilation : { warnings, errors } } , err } = webpackInfo
@@ -163,7 +163,7 @@ describe('style block features', () => {
163
163
} )
164
164
165
165
it ( 'postcss lang' , done => {
166
- test ( {
166
+ mockBundleAndRun ( {
167
167
entry : 'postcss-lang.vue'
168
168
} , ( window ) => {
169
169
let style = window . document . querySelector ( 'style' ) . textContent
@@ -175,7 +175,7 @@ describe('style block features', () => {
175
175
176
176
it ( 'css-modules' , done => {
177
177
function testWithIdent ( localIdentName , regexToMatch , cb ) {
178
- test ( {
178
+ mockBundleAndRun ( {
179
179
entry : 'css-modules.vue' ,
180
180
vue : {
181
181
cssModules : localIdentName && {
0 commit comments