@@ -30,18 +30,16 @@ context('Unit tests', () => {
3030 expect ( add ( 'foo' , 'Bar' ) ) . to . equal ( 'fooBar' )
3131 } )
3232
33- it ( 'fixes webpack loader source-map path ' , ( ) => {
33+ it ( 'fixes webpack loader source-map pathes ' , ( ) => {
3434 const coverage = {
35- '/folder/module.js' : {
36- inputSourceMap : {
37- sources : [ '/folder/module.js' ]
38- }
39- } ,
40- '/folder/component.vue' : {
35+ '/absolute/src/component.vue' : {
36+ path : '/absolute/src/component.vue' ,
4137 inputSourceMap : {
4238 sources : [
43- '/folder/node_modules/cache-loader/dist/cjs.js??ref--0-0!/folder/node_modules/vue-loader/lib/index.js??vue-loader-options!/folder/component.vue?vue&type=script&lang=ts&'
44- ]
39+ '/folder/node_modules/cache-loader/dist/cjs.js??ref--0-0!/folder/node_modules/vue-loader/lib/index.js??vue-loader-options!component.vue?vue&type=script&lang=ts&' ,
40+ 'otherFile.js'
41+ ] ,
42+ sourceRoot : 'src'
4543 }
4644 } ,
4745 '/folder/module-without-sourcemap.js' : {
@@ -51,11 +49,17 @@ context('Unit tests', () => {
5149
5250 fixSourcePathes ( coverage )
5351
54- expect ( coverage [ '/folder/module.js' ] . inputSourceMap . sources )
55- . to . deep . equal ( [ '/folder/module.js' ] )
56- expect ( coverage [ '/folder/component.vue' ] . inputSourceMap . sources )
57- . to . deep . equal ( [ '/folder/component.vue' ] )
58- expect ( coverage [ '/folder/module-without-sourcemap.js' ] . path )
59- . to . eq ( '/folder/module-without-sourcemap.js' )
52+ expect ( coverage ) . to . deep . eq ( {
53+ '/absolute/src/component.vue' : {
54+ path : '/absolute/src/component.vue' ,
55+ inputSourceMap : {
56+ sources : [ '/absolute/src/component.vue' , 'otherFile.js' ] ,
57+ sourceRoot : ''
58+ }
59+ } ,
60+ '/folder/module-without-sourcemap.js' : {
61+ path : '/folder/module-without-sourcemap.js'
62+ }
63+ } )
6064 } )
6165} )
0 commit comments