File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export const defaultNamespace = '__coverage__';
11
11
12
12
export default function prelude ( state ) {
13
13
const { variable, locations} = getCoverageMeta ( state ) ;
14
- const name = state . file . opts . filenameRelative ;
14
+ const name = state . file . opts . filenameRelative . replace ( ` ${ process . cwd ( ) } ${ path . sep } ` , '' ) ;
15
15
const namespace = state . opts && state . opts . global || defaultNamespace ;
16
16
return render ( {
17
17
VARIABLE : variable ,
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import {defaultNamespace as namespace} from '../../../src/prelude';
6
6
7
7
export default function runFixture ( fixtureName ) {
8
8
const fixturePath = path . resolve ( __dirname , `../../fixture/${ fixtureName } .fixture.js` ) ;
9
+ const relativeFixturePath = fixturePath . replace ( `${ process . cwd ( ) } ${ path . sep } ` , '' ) ;
9
10
return transform ( fixturePath )
10
11
. then ( ( { code} ) => {
11
12
const sandbox = {
@@ -14,7 +15,7 @@ export default function runFixture(fixtureName) {
14
15
exports : { }
15
16
} ;
16
17
runInNewContext ( code , sandbox ) ;
17
- const fileCoverage = sandbox . global [ namespace ] [ fixturePath ] ;
18
+ const fileCoverage = sandbox . global [ namespace ] [ relativeFixturePath ] ;
18
19
return codec . decodeAll ( fileCoverage ) ;
19
20
} )
20
21
. catch ( error => console . error ( error ) ) ; // eslint-disable-line no-console
You can’t perform that action at this time.
0 commit comments