@@ -49,40 +49,15 @@ export default function textFixtures({
49
49
: fixturePath
50
50
)
51
51
it ( path . basename ( fixturePath ) . replace ( / \. j s $ / , '' ) , function ( ) {
52
- let source = input
53
- const position = source . indexOf ( '// position' )
54
- let selectionStart
55
- let selectionEnd
56
- if ( position >= 0 ) {
57
- selectionStart = selectionEnd = position
58
- source = source . replace ( / ^ \s * \/ \/ p o s i t i o n [ ^ \r \n ] * ( \r \n ? | \n ) / gm, '' )
59
- } else {
60
- selectionStart = source . indexOf ( '/* selectionStart */' )
61
- if ( selectionStart >= 0 ) {
62
- source = source . replace ( '/* selectionStart */' , '' )
63
- selectionEnd = source . indexOf ( '/* selectionEnd */' )
64
- if ( selectionEnd < 0 ) {
65
- throw new Error (
66
- '/* selectionEnd */ must be given if /* selectionStart */ is'
67
- )
68
- }
69
- source = source . replace ( '/* selectionEnd */' , '' )
70
- }
71
- }
72
- if ( selectionStart < 0 ) selectionStart = position
73
- if ( selectionEnd < 0 ) selectionEnd = position
74
52
const options = { ...transformOptions , ...fixture . options }
75
- if ( selectionStart >= 0 && selectionEnd >= 0 ) {
76
- Object . assign ( options , { selectionStart, selectionEnd } )
77
- }
78
53
79
54
const stats : Record < string , number > = { }
80
55
const report = [ ]
81
56
const parser = fixture . parser || defaultParser
82
57
const j = parser ? jscodeshift . withParser ( parser ) : jscodeshift
83
58
const doTransform = ( ) : string | null | void | undefined =>
84
59
transform (
85
- { path : file , source } ,
60
+ { path : file , source : input } ,
86
61
{
87
62
j,
88
63
jscodeshift : j ,
0 commit comments