Skip to content

Commit

Permalink
test for #16
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Sep 2, 2015
1 parent c83c017 commit 8c57fa7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/index.js
Expand Up @@ -208,6 +208,23 @@ describe( 'MagicString', function () {
assert.equal( loc.line, 1 );
assert.equal( loc.column, 9 );
});

it( 'should recover original names', function () {
var s = new MagicString( 'function Foo () {}' );

s.overwrite( 9, 12, 'Bar', true );

map = s.generateMap({
file: 'output.js',
source: 'input.js',
includeContent: true
});

smc = new SourceMapConsumer( map );

loc = smc.originalPositionFor({ line: 1, column: 9 });
assert.equal( loc.name, 'Foo' );
});
});

describe( 'getIndentString', function () {
Expand Down

0 comments on commit 8c57fa7

Please sign in to comment.