Rejecting promise when parsing fails

This commit is contained in:
Jeff Avallone
2014-12-20 10:47:41 -05:00
parent 6c5b36f334
commit ccdb29224a
2 changed files with 18 additions and 4 deletions
+10 -1
View File
@@ -9,7 +9,7 @@ describe('parser/javascript.js', function() {
this.parser = new Parser();
});
describe('#parser', function() {
describe('#parse', function() {
beforeEach(function() {
spyOn(regexpParser, 'parse');
@@ -42,6 +42,15 @@ describe('parser/javascript.js', function() {
.done();
});
it('rejects the returned promise with the exception thrown', function(done) {
this.parser.parse('/example')
.then(null, result => {
expect(result).toBeDefined();
})
.finally(done)
.done();
});
});
describe('#render', function() {