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.
svelte/test/runtime/samples/await-in-each/_config.js

31 lines
387 B

let fulfil;
const thePromise = new Promise(f => {
fulfil = f;
});
const items = [{
title: 'a title',
data: thePromise
}];
export default {
props: {
items
},
html: `
<p>a title: loading...</p>
`,
test({ assert, component, target }) {
fulfil(42);
return thePromise
.then(() => {
assert.htmlEqual(target.innerHTML, `
<p>a title: 42</p>
`);
});
}
};