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.
22 lines
786 B
22 lines
786 B
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' );
|
|
}
|
|
};
|
|
|