mirror of https://github.com/lukechilds/rollup.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
676 B
27 lines
676 B
9 years ago
|
const assert = require( 'assert' );
|
||
|
|
||
|
let warnings = [];
|
||
|
|
||
|
module.exports = {
|
||
|
description: 'preserves sourcemap chains when transforming',
|
||
|
before: () => warnings = [], // reset
|
||
|
options: {
|
||
|
plugins: [
|
||
|
{
|
||
|
name: 'fake plugin',
|
||
|
transform: function ( code ) {
|
||
|
return code;
|
||
|
}
|
||
|
}
|
||
|
],
|
||
|
onwarn ( msg ) {
|
||
|
warnings.push( msg );
|
||
|
}
|
||
|
},
|
||
|
test: () => {
|
||
|
assert.deepEqual( warnings, [
|
||
|
`Sourcemap is likely to be incorrect: a plugin ('fake plugin') was used to transform files, but didn't generate a sourcemap for the transformation. Consult https://github.com/rollup/rollup/wiki/Troubleshooting and the plugin documentation for more information`
|
||
|
]);
|
||
|
}
|
||
|
};
|