Skip to content

Commit

Permalink
failing test for #15
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Sep 2, 2015
1 parent 94b7fc3 commit daf2690
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/index.js
Expand Up @@ -190,6 +190,24 @@ describe( 'MagicString', function () {
assert.equal( loc.line, 1 );
assert.equal( loc.column, 10 );
});

it( 'should correctly map inserted content', function () {
var s = new MagicString( 'function Foo () {}' );

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

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.line, 1 );
assert.equal( loc.column, 9 );
});
});

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

0 comments on commit daf2690

Please sign in to comment.