import {Latus} from '@latus/core'; import {expect} from 'chai'; import { buildCondition, buildExpression, buildValue, } from '../src/builders'; import Context from '../src/context'; import compile from '../src/compilers/compile'; const {name} = require('../package.json'); describe(name, () => { let latus; let context; beforeEach(async () => { latus = Latus.mock([ ['@avocado/behavior', `${__dirname}/../src`], ]); await Promise.all(latus.invokeFlat('@latus/core/starting')); context = new Context({}, latus); }); describe('builders', () => { it('builds values', async () => { const passthroughs = [ buildCondition('is', []), buildExpression([]), buildValue(69), ]; for (let i = 0; i < passthroughs.length; i++) { const passthrough = passthroughs[i]; expect(passthrough).to.equal(buildValue(passthrough)); } expect(buildValue(420)).to.deep.equal({type: 'literal', value: 420}); }); }); });