Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
icecream17 authored May 16, 2023
1 parent 4dde985 commit e3f1cb7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/language-javascript/spec/javascript-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1968,19 +1968,19 @@ describe "JavaScript grammar", ->
it "detects some illegal uses of the optional chaining operator", ->
{tokens} = grammar.tokenizeLine('new a?.b')
expect(tokens[1]).toEqual value: 'a', scopes: ['source.js', 'meta.class.instance.constructor.js', 'entity.name.type.instance.js']
expect(tokens[2]).toEqual value: '?.', scopes: ['source.js', 'meta.class.instance.constructor.js', 'entity.name.type.instance.js', 'invalid.illegal.meta.delimiter.property.period.js']
expect(tokens[3]).toEqual value: 'b', scopes: ['source.js', 'meta.class.instance.constructor.js', 'entity.name.type.instance.js']
expect(tokens[2]).toEqual value: 'a', scopes: ['source.js', 'meta.class.instance.constructor.js', 'entity.name.type.instance.js']
expect(tokens[3]).toEqual value: '?.', scopes: ['source.js', 'meta.class.instance.constructor.js', 'entity.name.type.instance.js', 'invalid.illegal.meta.delimiter.property.optional.js']
expect(tokens[4]).toEqual value: 'b', scopes: ['source.js', 'meta.class.instance.constructor.js', 'entity.name.type.instance.js']
{tokens} = grammar.tokenizeLine('a?.b = function c () {}')
expect(tokens[0]).toEqual value: 'a', scopes: ['source.js', 'variable.other.object.js']
expect(tokens[1]).toEqual value: '?.', scopes: ['source.js', 'meta.function.js', 'invalid.illegal.meta.delimiter.method.period.js']
expect(tokens[1]).toEqual value: '?.', scopes: ['source.js', 'meta.function.js', 'invalid.illegal.meta.delimiter.method.optional.js']
expect(tokens[2]).toEqual value: 'b', scopes: ['source.js', 'meta.function.js', 'entity.name.function.js']
expect(tokens[4]).toEqual value: '=', scopes: ['source.js', 'meta.function.js', 'keyword.operator.assignment.js']
{tokens} = grammar.tokenizeLine('a?.b = _ => 2')
expect(tokens[0]).toEqual value: 'a', scopes: ['source.js', 'variable.other.object.js']
expect(tokens[1]).toEqual value: '?.', scopes: ['source.js', 'meta.function.arrow.js', 'invalid.illegal.meta.delimiter.method.period.js']
expect(tokens[1]).toEqual value: '?.', scopes: ['source.js', 'meta.function.arrow.js', 'invalid.illegal.meta.delimiter.method.optional.js']
expect(tokens[2]).toEqual value: 'b', scopes: ['source.js', 'meta.function.arrow.js', 'entity.name.function.js']
describe "strings and functions", ->
Expand Down

0 comments on commit e3f1cb7

Please sign in to comment.