@@ -12,7 +12,7 @@ describe('vue-loader', function () {
12
12
13
13
var testHTML = '<!DOCTYPE html><html><head></head><body></body></html>'
14
14
var outputDir = path . resolve ( __dirname , './output' )
15
- var loaderPath = path . resolve ( __dirname , '../' )
15
+ var loaderPath = 'expose?vueModule!' + path . resolve ( __dirname , '../' )
16
16
var globalConfig = {
17
17
output : {
18
18
path : outputDir ,
@@ -66,9 +66,9 @@ describe('vue-loader', function () {
66
66
67
67
it ( 'basic' , function ( done ) {
68
68
test ( {
69
- entry : './test/fixtures/basic.js '
69
+ entry : './test/fixtures/basic.vue '
70
70
} , function ( window ) {
71
- var module = window . testModule
71
+ var module = window . vueModule
72
72
expect ( module . template ) . to . contain ( '<h2 class="red">{{msg}}</h2>' )
73
73
expect ( module . data ( ) . msg ) . to . contain ( 'Hello from Component A!' )
74
74
var style = window . document . querySelector ( 'style' ) . textContent
@@ -79,9 +79,9 @@ describe('vue-loader', function () {
79
79
80
80
it ( 'pre-processors' , function ( done ) {
81
81
test ( {
82
- entry : './test/fixtures/pre.js '
82
+ entry : './test/fixtures/pre.vue '
83
83
} , function ( window ) {
84
- var module = window . testModule
84
+ var module = window . vueModule
85
85
expect ( module . template ) . to . contain (
86
86
'<h1>This is the app</h1>' +
87
87
'<comp-a></comp-a>' +
@@ -96,9 +96,9 @@ describe('vue-loader', function () {
96
96
97
97
it ( 'scoped style' , function ( done ) {
98
98
test ( {
99
- entry : './test/fixtures/scoped-css.js '
99
+ entry : './test/fixtures/scoped-css.vue '
100
100
} , function ( window ) {
101
- var module = window . testModule
101
+ var module = window . vueModule
102
102
var id = '_v-' + hash ( require . resolve ( './fixtures/scoped-css.vue' ) )
103
103
expect ( module . template ) . to . contain (
104
104
'<div ' + id + '=""><h1 ' + id + '="">hi</h1></div>\n' +
@@ -129,27 +129,27 @@ describe('vue-loader', function () {
129
129
130
130
it ( 'template import' , function ( done ) {
131
131
test ( {
132
- entry : './test/fixtures/template-import.js '
132
+ entry : './test/fixtures/template-import.vue '
133
133
} , function ( window ) {
134
- var module = window . testModule
134
+ var module = window . vueModule
135
135
expect ( module . template ) . to . contain ( '<div><h1>hello</h1></div>' )
136
136
done ( )
137
137
} )
138
138
} )
139
139
140
140
it ( 'script import' , function ( done ) {
141
141
test ( {
142
- entry : './test/fixtures/script-import-entry.js '
142
+ entry : './test/fixtures/script-import.vue '
143
143
} , function ( window ) {
144
- var module = window . testModule
144
+ var module = window . vueModule
145
145
expect ( module . data ( ) . msg ) . to . contain ( 'Hello from Component A!' )
146
146
done ( )
147
147
} )
148
148
} )
149
149
150
150
it ( 'source map' , function ( done ) {
151
151
var config = Object . assign ( { } , globalConfig , {
152
- entry : './test/fixtures/basic.js ' ,
152
+ entry : './test/fixtures/basic.vue ' ,
153
153
devtool : 'source-map'
154
154
} )
155
155
webpack ( config , function ( err ) {
@@ -181,7 +181,7 @@ describe('vue-loader', function () {
181
181
182
182
it ( 'autoprefix' , function ( done ) {
183
183
test ( {
184
- entry : './test/fixtures/autoprefix.js '
184
+ entry : './test/fixtures/autoprefix.vue '
185
185
} , function ( window ) {
186
186
var style = window . document . querySelector ( 'style' ) . textContent
187
187
expect ( style ) . to . contain ( 'body {\n -webkit-transform: scale(1);\n transform: scale(1);\n}' )
@@ -191,7 +191,7 @@ describe('vue-loader', function () {
191
191
192
192
it ( 'media-query' , function ( done ) {
193
193
test ( {
194
- entry : './test/fixtures/media-query.js '
194
+ entry : './test/fixtures/media-query.vue '
195
195
} , function ( window ) {
196
196
var style = window . document . querySelector ( 'style' ) . textContent
197
197
var id = '_v-' + hash ( require . resolve ( './fixtures/media-query.vue' ) )
@@ -202,7 +202,7 @@ describe('vue-loader', function () {
202
202
203
203
it ( 'extract CSS' , function ( done ) {
204
204
webpack ( Object . assign ( { } , globalConfig , {
205
- entry : './test/fixtures/extract-css.js ' ,
205
+ entry : './test/fixtures/extract-css.vue ' ,
206
206
vue : {
207
207
loaders : {
208
208
css : ExtractTextPlugin . extract ( 'css' ) ,
@@ -238,7 +238,7 @@ describe('vue-loader', function () {
238
238
239
239
it ( 'translates relative URLs and respects resolve alias' , function ( done ) {
240
240
test ( {
241
- entry : './test/fixtures/resolve.js ' ,
241
+ entry : './test/fixtures/resolve.vue ' ,
242
242
resolve : {
243
243
alias : {
244
244
fixtures : path . resolve ( __dirname , 'fixtures' )
@@ -251,7 +251,7 @@ describe('vue-loader', function () {
251
251
]
252
252
}
253
253
} , function ( window ) {
254
- var module = window . testModule
254
+ var module = window . vueModule
255
255
expect ( module . template ) . to . contain ( '<img src="logo.c9e00e.png">\n<img src="logo.c9e00e.png">' )
256
256
var style = window . document . querySelector ( 'style' ) . textContent
257
257
expect ( style ) . to . contain ( 'html { background-image: url(logo.c9e00e.png); }' )
0 commit comments