Skip to content

Commit 6b3e007

Browse files
committed
Avoid timing issues with polyfilled Promise
1 parent d4a7a45 commit 6b3e007

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

test/unit/path-effects.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
assert.equal(el.$.forward.$.compose.objSubpathChanged.firstCall.args[0].path, 'obj');
107107
assert.equal(el.$.forward.$.compose.objSubpathChanged.firstCall.args[0].value, nested.obj);
108108
// x-pe uses async PropertiesChanged
109-
Promise.resolve().then(() => {
109+
setTimeout(() => {
110110
assert.equal(el.$.pe._propertiesChanged.callCount, 1);
111111
assert.equal(el.$.pe._propertiesChanged.firstCall.args[1].obj, nested.obj);
112112
done();
@@ -124,7 +124,7 @@
124124
assert.equal(el.$.forward.$.compose.objSubpathChanged.firstCall.args[0].path, 'obj');
125125
assert.equal(el.$.forward.$.compose.objSubpathChanged.firstCall.args[0].value, nested.obj);
126126
// x-pe uses async PropertiesChanged
127-
Promise.resolve().then(() => {
127+
setTimeout(() => {
128128
assert.equal(el.$.pe._propertiesChanged.callCount, 1);
129129
assert.equal(el.$.pe._propertiesChanged.firstCall.args[1].obj, nested.obj);
130130
done();
@@ -142,7 +142,7 @@
142142
assert.equal(el.$.forward.$.compose.objSubpathChanged.firstCall.args[0].path, 'obj.value');
143143
assert.equal(el.$.forward.$.compose.objSubpathChanged.firstCall.args[0].value, 42);
144144
// x-pe uses async PropertiesChanged
145-
Promise.resolve().then(() => {
145+
setTimeout(() => {
146146
// Note the PropertiesMixin element only sees a deep set to 'nested.obj.value'
147147
// because it overrides _shouldPropertyChange to allow object re-sets through
148148
assert.equal(el.$.pe._propertiesChanged.callCount, 1);

0 commit comments

Comments
 (0)