refactor: Tag class support in registerTag()

This commit is contained in:
Jun Yang
2022-11-27 14:04:01 +08:00
parent 1f6ce7c822
commit 92992689cd
145 changed files with 694 additions and 768 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import { expect } from 'chai'
import { matchOperator } from '../../../src/parser/match-operator'
import { defaultOperators } from '../../../src/types'
import { defaultOperators } from '../../../src'
import { createTrie } from '../../../src/util/operator-trie'
describe('parser/matchOperator()', function () {
+15
View File
@@ -0,0 +1,15 @@
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)
})
})