mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 12:20:40 -07:00
16 lines
444 B
TypeScript
16 lines
444 B
TypeScript
import * as chai from 'chai'
|
|
import { ParseStream } from '../../../src/parser'
|
|
import { Token } from '../../../src/tokens'
|
|
|
|
const expect = chai.expect
|
|
|
|
describe('parseStream', () => {
|
|
it('should trigger "token" event', () => {
|
|
const token = { kind: 4 } as Token
|
|
const ps = new ParseStream([token], (token) => ({ token } as any))
|
|
let got
|
|
ps.on('token', token => { got = token }).start()
|
|
expect(got).to.equal(token)
|
|
})
|
|
})
|