mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Add test for ensuring that out.error only drops into .
This commit is contained in:
parent
83c84f7833
commit
56694c41a7
@ -287,6 +287,22 @@ describe('async-writer' , function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('should catch error in promise catch if `error` listener only set inside mixin', function(done) {
|
||||
const out = new AsyncStream();
|
||||
|
||||
out.catch((err) => {
|
||||
expect(err).to.be.an('error');
|
||||
expect(out.getOutput()).to.equal('1');
|
||||
done();
|
||||
}).then((data) => {
|
||||
throw new Error('Should not get here!');
|
||||
});
|
||||
|
||||
out.write('1');
|
||||
out.error(new Error('test'));
|
||||
out.write('2');
|
||||
});
|
||||
|
||||
it('should support chaining', function(done) {
|
||||
var errors = [];
|
||||
var out = new AsyncStream()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user