Created
May 29, 2016 21:36
-
-
Save BrianRosamilia/9fd236f10fd73240ca1549ecb9efff36 to your computer and use it in GitHub Desktop.
Generate Code and assert its validty with Handlebars + Acorn + ava
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let test = require('ava'); | |
let handlebars = require('handlebars'); | |
let acorn = require('acorn'); | |
test('foo', t => { | |
let q = handlebars.compile('let x = {{{tt}}}'); | |
let newAst = q({tt : "x => { console.log('Hello World!') }"}); | |
console.log(newAst); | |
var ast = acorn.parse(newAst,{}); | |
t.pass(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment