import { parse } from './parse'
describe('parse', () => {
it('can parse strings', () => {
expect(parse('foo bar {bar}')).toMatchSnapshot()
expect(parse('foobar')).toMatchSnapshot()
expect(parse('foobar ')).toMatchSnapshot()
expect(parse('foobar ')).toMatchSnapshot()
expect(parse('foobar {bar} ')).toMatchSnapshot()
})
it('throws an error when missing open nodes', () => {
expect(() => parse('bar')).toThrowErrorMatchingSnapshot()
expect(() => parse('bar')).toThrowErrorMatchingSnapshot()
expect(() => parse('bar')).toThrowErrorMatchingSnapshot()
})
it('throws an error when missing close nodes', () => {
expect(() => parse('bar')).toThrowErrorMatchingSnapshot()
expect(() => parse('bar')).toThrowErrorMatchingSnapshot()
expect(() => parse('bar')).toThrowErrorMatchingSnapshot()
})
})