mirror of https://github.com/lukechilds/rollup.git
Rich Harris
9 years ago
5 changed files with 31 additions and 2 deletions
@ -0,0 +1,22 @@ |
|||
const fs = require( 'fs' ); |
|||
const path = require( 'path' ); |
|||
const assert = require( 'assert' ); |
|||
const getLocation = require( '../../utils/getLocation' ); |
|||
const SourceMapConsumer = require( 'source-map' ).SourceMapConsumer; |
|||
|
|||
module.exports = { |
|||
description: 'generates correct sourcemap with reified namespace (#668)', |
|||
test: ( code, map ) => { |
|||
const smc = new SourceMapConsumer( map ); |
|||
|
|||
const main = fs.readFileSync( path.join( __dirname, 'main.js' ), 'utf-8' ); |
|||
const generatedLoc = getLocation( code, 'deepEqual' ); |
|||
|
|||
const actual = smc.originalPositionFor( generatedLoc ); |
|||
const expected = getLocation( main, 'deepEqual' ); |
|||
|
|||
assert.equal( actual.line, expected.line ); |
|||
assert.equal( actual.column, expected.column ); |
|||
assert.equal( actual.source, '../main.js' ); |
|||
} |
|||
}; |
@ -0,0 +1 @@ |
|||
export var bar = 42; |
@ -0,0 +1,3 @@ |
|||
import * as foo from './foo.js'; |
|||
|
|||
assert.deepEqual( foo, { bar: 42 }); |
Loading…
Reference in new issue