File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ function jsHandler(options) {
65
65
runTransformTest({
66
66
name: '${ codemodName } ',
67
67
path: require.resolve('./index.js'),
68
+ fixtureDir: \`\${__dirname}/__testfixtures__/\`,
68
69
});
69
70
` ,
70
71
'utf8'
Original file line number Diff line number Diff line change @@ -18,9 +18,7 @@ function testRunner(options, runTest) {
18
18
cwd : details . fixtureDir ,
19
19
absolute : true ,
20
20
} )
21
- . map ( ( entry ) =>
22
- entry . slice ( entry . indexOf ( '__testfixtures__' ) + '__testfixtures__' . length + 1 )
23
- )
21
+ . map ( ( entry ) => entry . slice ( details . fixtureDir . length ) )
24
22
. forEach ( ( filename ) => {
25
23
let extension = path . extname ( filename ) ;
26
24
let testName = filename . replace ( `.input${ extension } ` , '' ) ;
Original file line number Diff line number Diff line change @@ -7,13 +7,14 @@ function transformDetails(options) {
7
7
let transformPath = options . path ? options . path : getTransformPath ( process . cwd ( ) , options . name ) ;
8
8
let root = path . dirname ( transformPath ) ;
9
9
let transformType = getTransformType ( transformPath ) ;
10
+ let fixtureDir = options . fixtureDir ? options . fixtureDir : path . join ( root , '__testfixtures__/' ) ;
10
11
11
12
return {
12
13
name : options . name ,
13
14
root,
14
15
transformPath,
15
16
transformType,
16
- fixtureDir : path . join ( root , '__testfixtures__/' ) ,
17
+ fixtureDir,
17
18
} ;
18
19
}
19
20
You can’t perform that action at this time.
0 commit comments