Fix tween chain mock

This commit is contained in:
Sirz Benjie 2025-05-28 16:28:06 -05:00
parent df361accd7
commit 4934a9e357
No known key found for this signature in database
GPG Key ID: 38AC42D68CF5E138

View File

@ -124,13 +124,17 @@ export default class GameWrapper {
this.scene.tweens = {
add: data => {
if (data.onComplete) {
data.onComplete();
}
// TODO: our mock of `add` should have the same signature as the real one, which returns the tween
data.onComplete?.();
},
getTweensOf: () => [],
killTweensOf: () => [],
chain: () => null,
chain: data => {
// TODO: our mock of `chain` should have the same signature as the real one, which returns the chain
data?.tweens?.forEach(tween => tween.onComplete?.());
data.onComplete?.();
},
addCounter: data => {
if (data.onComplete) {
data.onComplete();