mirror of https://github.com/sveltejs/svelte
parent
aa3dcc06d6
commit
8b88992ba9
@ -0,0 +1,15 @@
|
|||||||
|
export default {
|
||||||
|
async test({ assert, target, component }) {
|
||||||
|
await Promise.resolve();
|
||||||
|
|
||||||
|
component.fail = 'wrong';
|
||||||
|
|
||||||
|
assert.htmlEqual(
|
||||||
|
target.innerHTML,
|
||||||
|
`
|
||||||
|
correct
|
||||||
|
correct
|
||||||
|
`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,24 @@
|
|||||||
|
<script>
|
||||||
|
import { writable } from 'svelte/store';
|
||||||
|
|
||||||
|
export let fail = 'incorrect'
|
||||||
|
|
||||||
|
const object = writable(Promise.resolve({ result: true }))
|
||||||
|
const array = writable(Promise.resolve([true]))
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#await $object then { result }}
|
||||||
|
{#if result}
|
||||||
|
correct
|
||||||
|
{:else}
|
||||||
|
{fail}
|
||||||
|
{/if}
|
||||||
|
{/await}
|
||||||
|
|
||||||
|
{#await $array then [result]}
|
||||||
|
{#if result}
|
||||||
|
correct
|
||||||
|
{:else}
|
||||||
|
{fail}
|
||||||
|
{/if}
|
||||||
|
{/await}
|
Loading…
Reference in new issue