Skip to content

Commit

Permalink
Check error is raised for invalid JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
aubergene committed Oct 6, 2016
1 parent 9fc7f69 commit af12b04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/data/json/invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ wrong: }
8 changes: 8 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ describe('readJsonSync()', function () {
})
})

describe('invalid', function () {
it('should raise an error', function () {
assert.throws(function () {
io.readJsonSync(testDataPath('json/invalid.json'))
}, Error)
})
})

})

describe('readPsvSync()', function () {
Expand Down

0 comments on commit af12b04

Please sign in to comment.