import { create_deferred } from '../../../helpers.js'; let deferred; export default { before_test() { deferred = create_deferred(); }, get props() { return { thePromise: deferred.promise }; }, html: `

loading...

`, async test({ assert, component, target }) { deferred.resolve(42); await deferred.promise; assert.htmlEqual(target.innerHTML, '

the value is 42

'); deferred = create_deferred(); component.thePromise = deferred.promise; assert.htmlEqual(target.innerHTML, '

loading...

'); deferred.reject(new Error('something broke')); try { await deferred.promise; } catch {} assert.htmlEqual(target.innerHTML, '

oh no! something broke

'); } };