mirror of https://github.com/sveltejs/svelte
parent
1beb5e8dc9
commit
4418ba6535
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: add top level snippets to instance scope
|
@ -0,0 +1,9 @@
|
||||
import { ok, test } from '../../test';
|
||||
|
||||
export default test({
|
||||
test({ target }) {
|
||||
const button = target.querySelector('button');
|
||||
ok(button);
|
||||
button.click();
|
||||
}
|
||||
});
|
@ -0,0 +1,13 @@
|
||||
<script>
|
||||
function log() {
|
||||
// Test that the log function is not hoisted. If it was, this would make the test
|
||||
// pass still, but Vitest would error because it sees that there are unhandled errors
|
||||
snippet;
|
||||
}
|
||||
</script>
|
||||
|
||||
{#snippet snippet()}Hello{/snippet}
|
||||
|
||||
<button on:click={log}>
|
||||
log snippet
|
||||
</button>
|
Loading…
Reference in new issue