File tree 1 file changed +7
-11
lines changed
1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 1
1
import { globbySync } from 'globby'
2
2
import type { Transform } from 'jscodeshift'
3
3
import type { TestOptions } from 'jscodeshift/src/testUtils'
4
- import { runInlineTest } from 'jscodeshift/src/testUtils'
4
+ import { applyTransform } from 'jscodeshift/src/testUtils'
5
5
import fs from 'node:fs'
6
6
import path from 'node:path'
7
7
@@ -41,33 +41,29 @@ export const runTransformTest = (
41
41
42
42
describe ( `${ testName } ${ extension } ` , ( ) => {
43
43
it ( 'transforms correctly' , ( ) => {
44
- runInlineTest (
44
+ const output = applyTransform (
45
45
transform ,
46
46
{ } ,
47
47
{
48
48
path : testInputPath ,
49
49
source : inputFileContent ,
50
50
} ,
51
- expectedOutput ,
52
- {
53
- parser,
54
- } ,
51
+ { parser } ,
55
52
)
53
+ expect ( output ) . toBe ( expectedOutput . trim ( ) )
56
54
} )
57
55
58
56
it ( 'is idempotent' , ( ) => {
59
- runInlineTest (
57
+ const output = applyTransform (
60
58
transform ,
61
59
{ } ,
62
60
{
63
61
path : testInputPath ,
64
62
source : inputFileContent ,
65
63
} ,
66
- expectedOutput ,
67
- {
68
- parser,
69
- } ,
64
+ { parser } ,
70
65
)
66
+ expect ( output ) . toBe ( expectedOutput . trim ( ) )
71
67
} )
72
68
} )
73
69
} )
You can’t perform that action at this time.
0 commit comments