Skip to content

Commit

Permalink
failing test for #1417
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed May 5, 2018
1 parent 8138627 commit 6437d7b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
48 changes: 48 additions & 0 deletions test/runtime/samples/await-then-catch-static/_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
let fulfil;

let promise = new Promise(f => {
fulfil = f;
});

export default {
solo: 1,
data: {
promise
},

html: `
<p>loading...</p>
`,

test(assert, component, target) {
fulfil(42);

return promise
.then(() => {
assert.htmlEqual(target.innerHTML, `
<p>loaded</p>
`);

promise = new Promise((f, r) => {
fulfil = f;
});

component.set({
promise
});

assert.htmlEqual(target.innerHTML, `
<p>loading...</p>
`);

fulfil(43);

return promise.then(() => {});
})
.then(() => {
assert.htmlEqual(target.innerHTML, `
<p>loaded</p>
`);
});
}
};
7 changes: 7 additions & 0 deletions test/runtime/samples/await-then-catch-static/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{#await promise}
<p>loading...</p>
{:then value}
<p>loaded</p>
{:catch error}
<p>errored</p>
{/await}

0 comments on commit 6437d7b

Please sign in to comment.