Skip to content

πŸ“ˆ Get real-time stocks from TradingView

Fix unloaded chart.periods

Mathieu Colmonb667c4657b68
diff --git a/tests/simpleChart.test.ts b/tests/simpleChart.test.ts
index 0b3aafa..1649eec 100644
--- a/tests/simpleChart.test.ts
+++ b/tests/simpleChart.test.ts
@@ -21,7 +21,10 @@ describe('Simple chart session', async () => {
timeframe: 'D',
});
- while (chart.infos.full_name !== 'BINANCE:BTCEUR') await utils.wait(100);
+ while (
+ chart.infos.full_name !== 'BINANCE:BTCEUR'
+ || !chart.periods.length
+ ) await utils.wait(100);
expect(chart.infos.full_name).toBe('BINANCE:BTCEUR');
expect(