|
|
|
|
@ -45,12 +45,14 @@ export default test({
|
|
|
|
|
`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
pop.click(); // second batch resolves but knows it needs to wait on first batch
|
|
|
|
|
// how it's on main
|
|
|
|
|
|
|
|
|
|
pop.click();
|
|
|
|
|
await tick();
|
|
|
|
|
assert.htmlEqual(
|
|
|
|
|
target.innerHTML,
|
|
|
|
|
`
|
|
|
|
|
a 0 | b 0 | c 0 | d 0
|
|
|
|
|
a 1 | b 2 | c 0 | d 2
|
|
|
|
|
<button>a++</button>
|
|
|
|
|
<button>c++</button>
|
|
|
|
|
<button>shift</button>
|
|
|
|
|
@ -63,7 +65,7 @@ export default test({
|
|
|
|
|
assert.htmlEqual(
|
|
|
|
|
target.innerHTML,
|
|
|
|
|
`
|
|
|
|
|
a 0 | b 0 | c 0 | d 0
|
|
|
|
|
a 1 | b 2 | c 0 | d 2
|
|
|
|
|
<button>a++</button>
|
|
|
|
|
<button>c++</button>
|
|
|
|
|
<button>shift</button>
|
|
|
|
|
@ -71,7 +73,7 @@ export default test({
|
|
|
|
|
`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
shift.click(); // first batch resolves, with it second can now resolve as well
|
|
|
|
|
shift.click(); // first batch resolves
|
|
|
|
|
await tick();
|
|
|
|
|
assert.htmlEqual(
|
|
|
|
|
target.innerHTML,
|
|
|
|
|
@ -83,5 +85,45 @@ export default test({
|
|
|
|
|
<button>pop</button>
|
|
|
|
|
`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// how it's on https://github.com/sveltejs/svelte/pull/17971
|
|
|
|
|
// pop.click(); // second batch resolves but knows it needs to wait on first batch
|
|
|
|
|
// await tick();
|
|
|
|
|
// assert.htmlEqual(
|
|
|
|
|
// target.innerHTML,
|
|
|
|
|
// `
|
|
|
|
|
// a 0 | b 0 | c 0 | d 0
|
|
|
|
|
// <button>a++</button>
|
|
|
|
|
// <button>c++</button>
|
|
|
|
|
// <button>shift</button>
|
|
|
|
|
// <button>pop</button>
|
|
|
|
|
// `
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
// shift.click(); // obsolete second batch promise (already rejected)
|
|
|
|
|
// await tick();
|
|
|
|
|
// assert.htmlEqual(
|
|
|
|
|
// target.innerHTML,
|
|
|
|
|
// `
|
|
|
|
|
// a 0 | b 0 | c 0 | d 0
|
|
|
|
|
// <button>a++</button>
|
|
|
|
|
// <button>c++</button>
|
|
|
|
|
// <button>shift</button>
|
|
|
|
|
// <button>pop</button>
|
|
|
|
|
// `
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
// shift.click(); // first batch resolves, with it second can now resolve as well
|
|
|
|
|
// await tick();
|
|
|
|
|
// assert.htmlEqual(
|
|
|
|
|
// target.innerHTML,
|
|
|
|
|
// `
|
|
|
|
|
// a 1 | b 2 | c 1 | d 3
|
|
|
|
|
// <button>a++</button>
|
|
|
|
|
// <button>c++</button>
|
|
|
|
|
// <button>shift</button>
|
|
|
|
|
// <button>pop</button>
|
|
|
|
|
// `
|
|
|
|
|
// );
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|