let fulfil; let promise = new Promise((f) => { fulfil = f; }); export default { props: { promise }, html: `

loading...

`, test({ assert, component, target }) { fulfil(42); return promise .then(() => { assert.htmlEqual( target.innerHTML, `

loaded

` ); promise = new Promise((f, _) => { fulfil = f; }); component.promise = promise; assert.htmlEqual( target.innerHTML, `

loading...

` ); fulfil(43); return promise.then(() => {}); }) .then(() => { assert.htmlEqual( target.innerHTML, `

loaded

` ); }); } };