babeler/test/context.js

14 lines
337 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('can update context', () => {
const sandbox = new Sandbox(parse('foo = 420'), {foo: 69});
expect(sandbox.context)
.to.deep.equal({foo: 69});
sandbox.run();
expect(sandbox.context)
.to.deep.equal({foo: 420});
});