Skip to content

Commit

Permalink
feat(test): add tests for invalid values in levels
Browse files Browse the repository at this point in the history
  • Loading branch information
hexjelly committed Jan 30, 2017
1 parent 054ab90 commit 1abd125
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,27 @@ test('Level save() method without modifications matches original level', t => {
}).catch(error => t.fail(error))
})

test('Invalid clipping value gives error', t => {
t.plan(1)
return Level.load('test/assets/levels/invalid_clip.lev').then(level => {
t.fail('Should not load')
}).catch(error => t.pass(error))
})

test('Invalid gravity value gives error', t => {
t.plan(1)
return Level.load('test/assets/levels/invalid_grav.lev').then(level => {
t.fail('Should not load')
}).catch(error => t.pass(error))
})

test('Invalid object value gives error', t => {
t.plan(1)
return Level.load('test/assets/levels/invalid_obj.lev').then(level => {
t.fail('Should not load')
}).catch(error => t.pass(error))
})

/* * * * * * * * *
* Replay tests *
* * * * * * * * */
Expand Down

0 comments on commit 1abd125

Please sign in to comment.