mirror of https://github.com/lukechilds/rollup.git
2 changed files with 6 additions and 7 deletions
@ -1,15 +1,15 @@ |
|||||
const path = require('path'); |
const path = require('path'); |
||||
const assert = require( 'assert' ); |
const assert = require( 'assert' ); |
||||
|
|
||||
function normalize( file ) { |
function normalize ( file ) { |
||||
return path.resolve( __dirname, file ).split( '\\' ).join( '/' ); |
return path.resolve( __dirname, file ).split( '\\' ).join( '/' ); |
||||
} |
} |
||||
|
|
||||
module.exports = { |
module.exports = { |
||||
description: 'throws on duplicate export * from', |
description: 'throws on duplicate export * from', |
||||
warnings(warnings) { |
warnings ( warnings ) { |
||||
assert.equal( warnings[0], `A module cannot have multiple exports with the same name ('foo')` + |
assert.deepEqual( warnings, [ |
||||
` from ${normalize( 'foo.js' )} and ${normalize( 'deep.js' )}` ); |
`Conflicting namespaces: ${normalize('main.js')} re-exports 'foo' from both ${normalize('foo.js')} (will be ignored) and ${normalize('deep.js')}.` |
||||
assert.equal( warnings.length, 1 ); |
]); |
||||
} |
} |
||||
}; |
}; |
||||
|
Loading…
Reference in new issue