Skip to content
Permalink
Browse files
Fix code style
  • Loading branch information
lukastaegert committed May 15, 2018
1 parent 8840dc2 commit 60653880da906482f4a5b2874560e1cf2b7b0cf0
Showing 1 changed file with 24 additions and 24 deletions.
@@ -2,8 +2,8 @@ const assert = require('assert');
const path = require('path');
const rollup = require('../../dist/rollup');
const { executeBundle, loader } = require('../utils.js');
const { SourceMapConsumer } = require( 'source-map' );
const { getLocator } = require( 'locate-character' );
const { SourceMapConsumer } = require('source-map');
const { getLocator } = require('locate-character');

describe('sanity checks', () => {
it('exists', () => {
@@ -162,30 +162,30 @@ describe('sanity checks', () => {
});

describe('in-memory sourcemaps', () => {
it( 'generates an in-memory sourcemap', () => {
return rollup.rollup({
input: 'main',
plugins: [loader({ main: `console.log( 42 );` })],
})
.then(bundle => {
return bundle.generate({
format: 'cjs',
sourcemap: true,
sourcemapFile: path.resolve( 'bundle.js' )
it('generates an in-memory sourcemap', () => {
return rollup
.rollup({
input: 'main',
plugins: [loader({ main: `console.log( 42 );` })]
})
.then(bundle => {
return bundle.generate({
format: 'cjs',
sourcemap: true,
sourcemapFile: path.resolve('bundle.js')
});
})
.then(generated => {
const smc = new SourceMapConsumer(generated.map);
const locator = getLocator(generated.code, { offsetLine: 1 });

const generatedLoc = locator('42');
const loc = smc.originalPositionFor(generatedLoc); // 42
assert.equal(loc.source, 'main');
assert.equal(loc.line, 1);
assert.equal(loc.column, 13);
});
})
.then(generated => {
const smc = new SourceMapConsumer( generated.map );
const locator = getLocator( generated.code, { offsetLine: 1 });

let generatedLoc = locator( '42' );
let loc = smc.originalPositionFor( generatedLoc ); // 42
assert.equal( loc.source, 'main' );
assert.equal( loc.line, 1 );
assert.equal( loc.column, 13 );
});
});

});

describe('deprecations', () => {

0 comments on commit 6065388

Please sign in to comment.