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/script-and-style/test.js

18 lines
436 B

export function test({ assert, input, preprocessed }) {
const content = '<h1>Hello world!</h1>';
const original = input.locate(content);
const transformed = preprocessed.locate_1('<h1>Hello world!</h1>');
assert.deepEqual(
preprocessed.mapConsumer.originalPositionFor(transformed),
{
source: 'input.svelte',
name: null,
line: original.line + 1,
column: original.column
},
`failed to locate "${content}"`
);
}