Skip to content

Commit

Permalink
Add CheckPlayer verbose logging
Browse files Browse the repository at this point in the history
  • Loading branch information
wvanhaevre committed Dec 24, 2024
1 parent 73e4f30 commit eb6a941
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion e2e/src/components/TestableTHEOplayerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ export const getTestPlayer = async (timeout = 5000, poll = 200): Promise<THEOpla
setTimeout(() => {
if (testPlayer) {
// Player is ready.
console.debug(`[checkPlayer] ready id: ${testPlayerId}`);
console.debug(`[checkPlayer] Success: player ${testPlayerId} ready.`);
resolve(testPlayer);
} else if (Date.now() - start > timeout) {
// Too late.
console.debug(`[checkPlayer] Failed: timeout reached for ${testPlayerId}.`);
reject('Player not ready');
} else {
// Wait & try again.
console.debug(`[checkPlayer] Player ${testPlayerId} not ready yet. Retrying...`);
checkPlayer();
}
}, poll);
Expand Down

0 comments on commit eb6a941

Please sign in to comment.