mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
307 B
25 lines
307 B
5 years ago
|
let fulfil;
|
||
|
|
||
|
const thePromise = new Promise(f => {
|
||
|
fulfil = f;
|
||
|
});
|
||
|
|
||
|
export default {
|
||
|
props: {
|
||
|
thePromise
|
||
|
},
|
||
|
|
||
|
html: `
|
||
|
loading...
|
||
|
`,
|
||
|
|
||
|
async test({ assert, component, target }) {
|
||
|
fulfil([]);
|
||
|
|
||
|
await thePromise;
|
||
|
|
||
|
assert.htmlEqual(target.innerHTML, `
|
||
|
<p>promise array is empty</p>
|
||
|
`);
|
||
|
}
|
||
|
};
|