This commit is contained in:
Kurt Hutten IrevDev
2022-11-27 14:07:03 +11:00
parent 6f24e75f92
commit 1831aad321
5 changed files with 34 additions and 31 deletions

View File

@ -50,14 +50,13 @@ log(5, myVar)`
expect(recasted).toBe(code.trim())
})
it('function declaration with call', () => {
const code =
[
'fn funcN = (a, b) => {',
' return a + b',
'}',
'const theVar = 60',
'const magicNum = funcN(9, theVar)',
].join('\n')
const code = [
'fn funcN = (a, b) => {',
' return a + b',
'}',
'const theVar = 60',
'const magicNum = funcN(9, theVar)',
].join('\n')
const { ast } = code2ast(code)
const recasted = recast(ast)
expect(recasted).toBe(code.trim())