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

loading...

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

loaded

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

loading...

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

loaded

`); }); } };