chore: test component exports + async (#17241)

Regression-test, this works already. Closes #16657
pull/17245/head
Simon H 9 months ago committed by GitHub
parent 52a36bdb35
commit 5546272988
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,9 @@
<script>
export function foo() {
console.log('foo');
}
const value = await Promise.resolve('bar');
export const bar = () => console.log(value);
</script>

@ -0,0 +1,12 @@
import { tick } from 'svelte';
import { test } from '../../test';
export default test({
async test({ assert, target, logs }) {
await tick();
const [log] = target.querySelectorAll('button');
log.click();
assert.deepEqual(logs, ['foo', 'bar']);
}
});

@ -0,0 +1,11 @@
<script>
import Child from './Child.svelte';
let child;
</script>
<Child bind:this={child} />
<button onclick={() => {
child.foo();
child.bar();
}}>log</button>
Loading…
Cancel
Save