-
Notifications
You must be signed in to change notification settings - Fork 110
/
Copy pathfix-source-paths.cy.js
36 lines (33 loc) · 1.06 KB
/
fix-source-paths.cy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { fixSourcePaths } from '../../support-utils'
describe('fixSourcePaths', () => {
it('fixes webpack loader source-map pathes', () => {
const coverage = {
'/absolute/src/component.vue': {
path: '/absolute/src/component.vue',
inputSourceMap: {
sources: [
'/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&',
'otherFile.js'
],
sourceRoot: 'src'
}
},
'/folder/module-without-sourcemap.js': {
path: '/folder/module-without-sourcemap.js'
}
}
fixSourcePaths(coverage)
expect(coverage).to.deep.eq({
'/absolute/src/component.vue': {
path: '/absolute/src/component.vue',
inputSourceMap: {
sources: ['/absolute/src/component.vue', 'otherFile.js'],
sourceRoot: ''
}
},
'/folder/module-without-sourcemap.js': {
path: '/folder/module-without-sourcemap.js'
}
})
})
})