mirror of https://github.com/sveltejs/svelte
Merge pull request #3101 from sveltejs/gh-3044
always bail out of hoisting on encountering local statepull/3107/head
commit
5975eb5a08
@ -0,0 +1,15 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<button>Click me</button>
|
||||||
|
`,
|
||||||
|
|
||||||
|
async test({ assert, target, window }) {
|
||||||
|
const event = new window.MouseEvent('click');
|
||||||
|
const button = target.querySelector('button');
|
||||||
|
|
||||||
|
await button.dispatchEvent(event);
|
||||||
|
assert.htmlEqual(target.innerHTML, `
|
||||||
|
<button>A,B,C</button>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,10 @@
|
|||||||
|
<script>
|
||||||
|
let array = ['a', 'b', 'c'];
|
||||||
|
$: uppercase = array.map(str => str.toUpperCase());
|
||||||
|
|
||||||
|
function onClick() {
|
||||||
|
this.innerHTML = uppercase.join(',');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<button on:click={onClick}>Click me</button>
|
Loading…
Reference in new issue