mirror of https://github.com/sveltejs/svelte
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.
35 lines
693 B
35 lines
693 B
3 years ago
|
export function test({ assert, input, js }) {
|
||
|
let expected;
|
||
|
|
||
|
let start;
|
||
|
let actual;
|
||
|
|
||
|
start = js.locate('insert(target, h1');
|
||
|
expected = input.locate('<h1');
|
||
|
actual = js.mapConsumer.originalPositionFor({
|
||
|
line: start.line + 1,
|
||
|
column: start.column
|
||
|
});
|
||
|
|
||
|
assert.deepEqual(actual, {
|
||
|
source: 'input.svelte',
|
||
|
name: null,
|
||
|
line: expected.line + 1,
|
||
|
column: expected.column
|
||
|
});
|
||
|
|
||
|
start = js.locate('insert(target, div');
|
||
|
expected = input.locate('<div');
|
||
|
actual = js.mapConsumer.originalPositionFor({
|
||
|
line: start.line + 1,
|
||
|
column: start.column
|
||
|
});
|
||
|
|
||
|
assert.deepEqual(actual, {
|
||
|
source: 'input.svelte',
|
||
|
name: null,
|
||
|
line: expected.line + 1,
|
||
|
column: expected.column
|
||
|
});
|
||
|
}
|