MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / assertTransform

Function assertTransform

packages/main/src/babel/babel.test.ts:18–34  ·  view source on GitHub ↗
(
    src: string,
    expected: string,
    plugin: babel.PluginObj<any>,
)

Source from the content-addressed store, hash-verified

16}
17
18function 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
36function testTransform(
37 name: string,

Callers 2

testTransformFunction · 0.85
babel.test.tsFile · 0.85

Calls 1

removeExtraSpacesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…