mirror of https://github.com/curbengh/hexo-yam
test(js): throw error on invalid input
This commit is contained in:
parent
9e67d11e8a
commit
c42b9040a6
|
@ -97,4 +97,12 @@ describe('js', () => {
|
|||
|
||||
expect(result).toBe(input)
|
||||
})
|
||||
|
||||
test('invalid string', () => {
|
||||
const invalid = 'console.log("\\");'
|
||||
|
||||
expect(() => {
|
||||
j(invalid, { path })
|
||||
}).toThrow('SyntaxError')
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue