diff --git a/test/runtime/samples/await-then-catch-order/_config.js b/test/runtime/samples/await-then-catch-order/_config.js new file mode 100644 index 0000000000..4a8f4df77c --- /dev/null +++ b/test/runtime/samples/await-then-catch-order/_config.js @@ -0,0 +1,27 @@ +let fulfil; + +let thePromise = new Promise(f => { + fulfil = f; +}); + +export default { + data: { + thePromise + }, + + html: ` +

loading...

true!

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

the value is 42

true!

+ `); + }); + + } +}; diff --git a/test/runtime/samples/await-then-catch-order/main.html b/test/runtime/samples/await-then-catch-order/main.html new file mode 100644 index 0000000000..87b37bf27d --- /dev/null +++ b/test/runtime/samples/await-then-catch-order/main.html @@ -0,0 +1,11 @@ +{#await thePromise} +

loading...

+{:then theValue} +

the value is {theValue}

+{:catch theError} +

oh no! {theError.message}

+{/await} + +{#if true} +

true!

+{/if}