(
src: string,
expected: string,
plugin: babel.PluginObj<any>,
)
| 16 | } |
| 17 | |
| 18 | function assertTransform( |
| 19 | src: string, |
| 20 | expected: string, |
| 21 | plugin: babel.PluginObj<any>, |
| 22 | ): void { |
| 23 | const ast = parser.parse(src, { |
| 24 | sourceType: 'module', |
| 25 | plugins: ['jsx'], |
| 26 | }) |
| 27 | |
| 28 | babel.traverse(ast, plugin.visitor, undefined, {filename: `${cwd}/${file}`}) |
| 29 | const res = new generator.CodeGenerator(ast).generate() |
| 30 | const output = removeExtraSpaces(res.code) |
| 31 | const expectedOutput = removeExtraSpaces(expected) |
| 32 | |
| 33 | test.expect(output).toBe(expectedOutput) |
| 34 | } |
| 35 | |
| 36 | function testTransform( |
| 37 | name: string, |
no test coverage detected
searching dependent graphs…