perf: parse filenames in parse() insteadof render()

This commit is contained in:
harttle
2021-09-30 22:15:09 +08:00
committed by Jun Yang
parent 24f5346084
commit 8273c17dab
13 changed files with 80 additions and 68 deletions
+3 -3
View File
@@ -8,14 +8,14 @@ chai.use(sinonChai)
const expect = chai.expect
describe('PropertyAccessToken', function () {
describe('getVariableAsText', function () {
describe('#propertyName', function () {
it('should return correct value for IdentifierToken', function () {
const token = new PropertyAccessToken(new IdentifierToken('foo', 0, 3), [], 3)
expect(token.getVariableAsText()).to.equal('foo')
expect(token.propertyName).to.equal('foo')
})
it('should return correct value for QuotedToken', function () {
const token = new PropertyAccessToken(new QuotedToken('"foo bar"', 0, 9), [], 9)
expect(token.getVariableAsText()).to.equal('foo bar')
expect(token.propertyName).to.equal('foo bar')
})
})
})