test(js): throw error on invalid input

This commit is contained in:
MDLeom 2020-05-25 09:36:21 +01:00
parent 9e67d11e8a
commit c42b9040a6
No known key found for this signature in database
GPG Key ID: 21EA847C35D6E034
1 changed files with 8 additions and 0 deletions

View File

@ -97,4 +97,12 @@ describe('js', () => {
expect(result).toBe(input)
})
test('invalid string', () => {
const invalid = 'console.log("\\");'
expect(() => {
j(invalid, { path })
}).toThrow('SyntaxError')
})
})