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.
svelte/test/sourcemaps/samples/basic/test.js

35 lines
701 B

export function test({ assert, smc, locateInSource, locateInGenerated }) {
const expected = locateInSource( 'foo.bar.baz' );
let start;
let actual;
start = locateInGenerated( 'foo.bar.baz' );
actual = smc.originalPositionFor({
line: start.line + 1,
column: start.column
});
assert.deepEqual( actual, {
source: 'input.svelte',
name: null,
line: expected.line + 1,
column: expected.column
});
start = locateInGenerated( 'foo.bar.baz', start.character + 1 );
actual = smc.originalPositionFor({
line: start.line + 1,
column: start.column
});
assert.deepEqual( actual, {
source: 'input.svelte',
name: null,
line: expected.line + 1,
column: expected.column
});
}