Skip to content

📈 Get real-time stocks from TradingView

Better test + Fix 4th (add delay)

Mathieu Colmon510d6911b154
diff --git a/test.js b/test.js
index b449e70..6347acc 100644
--- a/test.js
+++ b/test.js
@@ -1,3 +1,4 @@
+/* eslint-disable no-continue */
/* eslint-disable no-await-in-loop */
/* eslint-disable import/no-dynamic-require */
/* eslint-disable no-restricted-syntax */
@@ -37,6 +38,7 @@ function success() {
console.info('§90§30§104 ==== Starting tests ==== §0');
for (const file of fs.readdirSync('./tests').filter((f) => f.endsWith('.js'))) {
+ if (process.argv[2] && !file.startsWith(process.argv[2])) continue;
const test = require(`./tests/${file}`);
const name = file.replace(/\.js/g, '');
TESTS[name] = { errors: 0, warnings: 0 };
diff --git a/tests/4. Indicators.js b/tests/4. Indicators.js
index 0073f1a..6a92231 100644
--- a/tests/4. Indicators.js
+++ b/tests/4. Indicators.js
@@ -65,9 +65,10 @@ module.exports = async (log, success, warn, err, cb) => {
QTY += 10;
log('TRY WITH', QTY, '%');
- indicator.setOption('default_qty_value', QTY);
-
- SuperTrend.setIndicator(indicator);
+ setTimeout(() => {
+ indicator.setOption('default_qty_value', QTY);
+ SuperTrend.setIndicator(indicator);
+ }, 1000);
});
});