Skip to content

Commit

Permalink
chore: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloricciuti committed Oct 10, 2024
1 parent 82927bb commit 931eb74
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,55 @@ describe('SveltePlugin#getCodeAction', () => {
}
]);
});

it('should provide ignore comment in script tags', async () => {
(
await expectCodeActionFor(svelteIgnoreCodeAction, {
diagnostics: [
{
severity: DiagnosticSeverity.Warning,
code: 'state_referenced_locally',
range: Range.create(
{ line: 13, character: 9 },
{ line: 13, character: 14 }
),
message: '',
source: 'svelte'
}
]
})
).toEqual([
{
edit: {
documentChanges: [
{
edits: [
{
newText: `\t// svelte-ignore state_referenced_locally${EOL}\t`,
range: {
end: {
character: 0,
line: 13
},
start: {
character: 0,
line: 13
}
}
}
],
textDocument: {
uri: getUri(svelteIgnoreCodeAction),
version: null
}
}
]
},
title: '(svelte) Disable state_referenced_locally for this line',
kind: 'quickfix'
}
]);
});
});

describe('It should provide svelte ignore code actions (TypeScript)', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@
href=""
>about</a>
{/if}

<script>
let value = $state("");
let x = value;
</script>

0 comments on commit 931eb74

Please sign in to comment.