babeler/test/literal.js

14 lines
405 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 Literal', () => {
expect(new Sandbox(parse('69')).next().value)
.to.deep.include({value: 69});
expect(new Sandbox(parse('"420"')).next().value)
.to.deep.include({value: '420'});
expect(new Sandbox(parse('420.69')).next().value)
.to.deep.include({value: 420.69});
});