babeler/test/if-statement.js

12 lines
338 B
JavaScript
Raw Normal View History

2022-02-27 07:32:34 -06:00
import {parse} from '@babel/parser';
import {expect} from 'chai';
import Sandbox from '../src/sandbox';
it('evaluates IfStatement', () => {
expect(new Sandbox(parse('if (false) { 69; }')).next())
.to.deep.include({done: true});
expect(new Sandbox(parse('if (true) { 69; }')).next().value)
.to.deep.include({value: 69});
});