Skip to content

Commit 542f7c5

Browse files
committed
test: remove unused code for testing conversion within selections
1 parent 317b31a commit 542f7c5

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

test/testFixtures.ts

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -49,40 +49,15 @@ export default function textFixtures({
4949
: fixturePath
5050
)
5151
it(path.basename(fixturePath).replace(/\.js$/, ''), 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*\/\/ position[^\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
7452
const options = { ...transformOptions, ...fixture.options }
75-
if (selectionStart >= 0 && selectionEnd >= 0) {
76-
Object.assign(options, { selectionStart, selectionEnd })
77-
}
7853

7954
const stats: Record<string, number> = {}
8055
const report = []
8156
const parser = fixture.parser || defaultParser
8257
const j = parser ? jscodeshift.withParser(parser) : jscodeshift
8358
const doTransform = (): string | null | void | undefined =>
8459
transform(
85-
{ path: file, source },
60+
{ path: file, source: input },
8661
{
8762
j,
8863
jscodeshift: j,

0 commit comments

Comments
 (0)