@@ -10,6 +10,7 @@ var genId = require('../lib/gen-id')
10
10
var SourceMapConsumer = require ( 'source-map' ) . SourceMapConsumer
11
11
var ExtractTextPlugin = require ( "extract-text-webpack-plugin" )
12
12
var compiler = require ( '../lib/template-compiler' )
13
+ var normalizeNewline = require ( 'normalize-newline' )
13
14
14
15
var loaderPath = 'expose?vueModule!' + path . resolve ( __dirname , '../' )
15
16
var mfs = new MemoryFS ( )
@@ -103,6 +104,7 @@ describe('vue-loader', function () {
103
104
104
105
expect ( module . data ( ) . msg ) . to . contain ( 'Hello from Component A!' )
105
106
var style = window . document . querySelector ( 'style' ) . textContent
107
+ style = normalizeNewline ( style )
106
108
expect ( style ) . to . contain ( 'comp-a h2 {\n color: #f00;\n}' )
107
109
done ( )
108
110
} )
@@ -161,6 +163,7 @@ describe('vue-loader', function () {
161
163
expect ( vnode . children [ 4 ] [ 0 ] . data . staticClass ) . to . equal ( 'test' )
162
164
163
165
var style = window . document . querySelector ( 'style' ) . textContent
166
+ style = normalizeNewline ( style )
164
167
expect ( style ) . to . contain ( '.test[' + id + '] {\n color: yellow;\n}' )
165
168
expect ( style ) . to . contain ( '.test[' + id + ']:after {\n content: \'bye!\';\n}' )
166
169
expect ( style ) . to . contain ( 'h1[' + id + '] {\n color: green;\n}' )
@@ -235,6 +238,7 @@ describe('vue-loader', function () {
235
238
entry : './test/fixtures/media-query.vue'
236
239
} , function ( window ) {
237
240
var style = window . document . querySelector ( 'style' ) . textContent
241
+ style = normalizeNewline ( style )
238
242
var id = 'data-v-' + genId ( require . resolve ( './fixtures/media-query.vue' ) )
239
243
expect ( style ) . to . contain ( '@media print {\n.foo[' + id + '] {\n color: #000;\n}\n}' )
240
244
done ( )
@@ -255,6 +259,7 @@ describe('vue-loader', function () {
255
259
]
256
260
} ) , function ( ) {
257
261
var css = mfs . readFileSync ( '/test.output.css' ) . toString ( )
262
+ css = normalizeNewline ( css )
258
263
expect ( css ) . to . contain ( 'h1 {\n color: #f00;\n}\n\nh2 {\n color: green;\n}' )
259
264
done ( )
260
265
} )
@@ -322,6 +327,7 @@ describe('vue-loader', function () {
322
327
}
323
328
} , function ( window ) {
324
329
var style = window . document . querySelector ( 'style' ) . textContent
330
+ style = normalizeNewline ( style )
325
331
expect ( style ) . to . contain ( 'h1 {\n color: red;\n font-size: 14px\n}' )
326
332
done ( )
327
333
} )
@@ -398,6 +404,7 @@ describe('vue-loader', function () {
398
404
var style = [ ] . slice . call ( window . document . querySelectorAll ( 'style' ) ) . map ( function ( style ) {
399
405
return style . textContent
400
406
} ) . join ( '\n' )
407
+ style = normalizeNewline ( style )
401
408
expect ( style ) . to . contain ( '.' + className + ' {\n color: red;\n}' )
402
409
403
410
// animation name
0 commit comments