mirror of https://github.com/lukechilds/rollup.git
Bogdan Chadkin
9 years ago
5 changed files with 62 additions and 3 deletions
@ -0,0 +1,25 @@ |
|||
var assert = require( 'assert' ); |
|||
|
|||
module.exports = { |
|||
description: 'throws error only with first plugin transformBundle', |
|||
options: { |
|||
plugins: [ |
|||
{ |
|||
name: 'plugin1', |
|||
transformBundle: function () { |
|||
throw Error('Something happend 1'); |
|||
} |
|||
}, |
|||
{ |
|||
name: 'plugin2', |
|||
transformBundle: function () { |
|||
throw Error('Something happend 2'); |
|||
} |
|||
} |
|||
] |
|||
}, |
|||
generateError: function ( err ) { |
|||
assert.equal( err.plugin, 'plugin1' ); |
|||
assert.equal( err.message, 'Error transforming bundle with \'plugin1\' plugin: Something happend 1' ); |
|||
} |
|||
}; |
@ -0,0 +1 @@ |
|||
console.log(1); |
@ -0,0 +1,29 @@ |
|||
var assert = require( 'assert' ); |
|||
var path = require( 'path' ); |
|||
|
|||
module.exports = { |
|||
description: 'throws error only with first plugin transform', |
|||
options: { |
|||
plugins: [ |
|||
{ |
|||
name: 'plugin1', |
|||
transform: function () { |
|||
throw Error('Something happend 1'); |
|||
} |
|||
}, |
|||
{ |
|||
name: 'plugin2', |
|||
transform: function () { |
|||
throw Error('Something happend 2'); |
|||
} |
|||
} |
|||
] |
|||
}, |
|||
error: function ( err ) { |
|||
var id = path.resolve( __dirname, 'main.js' ); |
|||
assert.equal( err.rollupTransform, true ); |
|||
assert.equal( err.id, id ); |
|||
assert.equal( err.plugin, 'plugin1' ); |
|||
assert.equal( err.message, 'Error transforming ' + id + ' with \'plugin1\' plugin: Something happend 1' ); |
|||
} |
|||
}; |
@ -0,0 +1 @@ |
|||
console.log(1); |
Loading…
Reference in new issue