mirror of https://github.com/sveltejs/svelte
parent
60771e99a7
commit
e799dac5be
@ -1,7 +1,7 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
skip: true, // TODO no template mappings, style mappings wrong
|
||||
skip: true, // TODO no template mappings
|
||||
client: ['foo'],
|
||||
css: ['.foo']
|
||||
css: [{ str: '.foo', strGenerated: '.foo.svelte-sg04hs' }]
|
||||
});
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
export function test({ assert, input, js, css }) {
|
||||
const expected_bar = input.locate('baritone');
|
||||
const expected_baz = input.locate('--bazitone');
|
||||
|
||||
let start = js.locate('bar');
|
||||
|
||||
const actualbar = js.mapConsumer.originalPositionFor({
|
||||
line: start.line + 1,
|
||||
column: start.column
|
||||
});
|
||||
|
||||
assert.deepEqual(actualbar, {
|
||||
source: 'input.svelte',
|
||||
name: 'baritone',
|
||||
line: expected_bar.line + 1,
|
||||
column: expected_bar.column
|
||||
});
|
||||
|
||||
start = css.locate('--baz');
|
||||
|
||||
const actualbaz = css.mapConsumer.originalPositionFor({
|
||||
line: start.line + 1,
|
||||
column: start.column
|
||||
});
|
||||
|
||||
assert.deepEqual(actualbaz, {
|
||||
source: 'input.svelte',
|
||||
name: '--bazitone',
|
||||
line: expected_baz.line + 1,
|
||||
column: expected_baz.column
|
||||
});
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
import { assert_mapped } from '../../helpers.js';
|
||||
import { EXTERNAL } from './_config';
|
||||
|
||||
export function test({ input, preprocessed }) {
|
||||
// Part from component, should be with offset
|
||||
assert_mapped({
|
||||
code: '--component-var',
|
||||
input: input.locate,
|
||||
preprocessed
|
||||
});
|
||||
|
||||
// Part from external file, should be without offset
|
||||
assert_mapped({
|
||||
filename: 'external.css',
|
||||
code: '--external-var',
|
||||
input: EXTERNAL,
|
||||
preprocessed
|
||||
});
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
export function test({ assert, preprocessed, js }) {
|
||||
assert.equal(preprocessed.error, undefined);
|
||||
|
||||
// sourcemap stores location only for 'answer = 42;'
|
||||
// not for 'var answer = 42;'
|
||||
[
|
||||
[js, 'foo.js', 'answer = 42;', 4],
|
||||
[js, 'bar.js', 'console.log(answer);', 0],
|
||||
[js, 'foo2.js', 'answer2 = 84;', 4],
|
||||
[js, 'bar2.js', 'console.log(answer2);', 0]
|
||||
].forEach(([where, sourcefile, content, column]) => {
|
||||
assert.deepEqual(
|
||||
where.mapConsumer.originalPositionFor(where.locate_1(content)),
|
||||
{
|
||||
source: sourcefile,
|
||||
name: null,
|
||||
line: 1,
|
||||
column
|
||||
},
|
||||
`failed to locate "${content}" from "${sourcefile}"`
|
||||
);
|
||||
});
|
||||
}
|
||||
Loading…
Reference in new issue