Skip to content

Commit

Permalink
Test that errors are passed to the buildEnd hook (#2450)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Sep 16, 2018
1 parent d5a910d commit 138033e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/hooks/index.js
Expand Up @@ -86,6 +86,33 @@ describe('hooks', () => {
});
});

it('passes errors to the buildEnd hook', () => {
let handledError = false;
return rollup
.rollup({
input: 'input',
plugins: [
loader({ input: `alert('hello')` }),
{
buildStart() {
this.error('build start error');
},
buildEnd(error) {
assert.equal(error.message, 'build start error');
handledError = true;
}
}
]
})
.catch(error => {
assert.ok(handledError);
assert.equal(error.message, 'build start error');
})
.then(() => {
assert.ok(handledError);
});
});

it('supports isExternal on plugin context', () => {
return rollup.rollup({
input: 'input',
Expand Down

0 comments on commit 138033e

Please sign in to comment.