fix: make error for missing a closing bracket clearer (#4974)

* fix: make error for missing a closing bracket clearer

* Fix test for error message

---------

Co-authored-by: Tom Pridham <pridham.tom@gmail.com>
This commit is contained in:
Jonathan Tran
2025-01-07 20:55:07 -05:00
committed by GitHub
parent c8afd3399b
commit a9ceaf2678
2 changed files with 25 additions and 6 deletions

View File

@ -47,7 +47,7 @@ describe('parsing errors', () => {
const result = parse(code)
if (err(result)) throw result
const error = result.errors[0]
expect(error.message).toBe('Unexpected token: (')
expect(error.sourceRange).toEqual([27, 28, 0])
expect(error.message).toBe('Array is missing a closing bracket(`]`)')
expect(error.sourceRange).toEqual([28, 29, 0])
})
})