import tap from 'tap'; import { parseToExpressionsList } from '../src'; const p = (x: string) => parseToExpressionsList([x]); tap.test('test', async (t) => { t.same(await p(`
`), ['true']); t.same(await p(`{{ a + b }}`), ['a + b']); t.same(await p(``), ['async(1)']); t.same(await p(``), ['async(1, 2)']); t.same(await p(``), ['a,"else",b']); t.same(await p(``), ['a?.b?.c']); t.match(await p(``), ["a?.b?.[0]"]); t.same(await p(``), ['action(1, 2)']); t.same( await p(` `), ['country.value.name', '/* let */country,of,keyvalue(countries)', 'country.key'] ); t.same(await p(``), ['usersModel/* as */ = async(users)']); t.same(await p(``), [ '/* let */item,of,items/* as */ = [1, 2, 3],trackBy,myTrack,i/* as */ = index', ]); });