From 93ee1302446f3c1132e0b1b89a2b714589c797c6 Mon Sep 17 00:00:00 2001 From: MillenniumEarl Date: Thu, 17 Dec 2020 22:44:46 +0100 Subject: [PATCH] Update test --- test/index-test.js | 2 +- test/suites/prefix-parser-test.js | 2 ++ test/suites/searcher-test.js | 9 +++++---- test/suites/user-scraper-test.js | 9 +++++---- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/test/index-test.js b/test/index-test.js index 0fab844..9b6a98e 100644 --- a/test/index-test.js +++ b/test/index-test.js @@ -11,7 +11,7 @@ const prefixParser = require("./suites/prefix-parser-test.js").suite; describe("Test basic function", function testBasic() { //#region Set-up - this.timeout(15000); // All tests in this suite get 15 seconds before timeout + this.timeout(30000); // All tests in this suite get 30 seconds before timeout //#endregion Set-up describe("Test credentials class", credentials.bind(this)); diff --git a/test/suites/prefix-parser-test.js b/test/suites/prefix-parser-test.js index d3e2327..dd02f5e 100644 --- a/test/suites/prefix-parser-test.js +++ b/test/suites/prefix-parser-test.js @@ -9,6 +9,7 @@ const { isEqual } = require("lodash"); const Credentials = require("../../app/scripts/classes/credentials.js"); const PrefixParser = require("../../app/scripts/classes/prefix-parser.js"); const { authenticate } = require("../../app/scripts/network-helper.js"); +const { fetchPlatformData } = require("../../app/scripts/platform-data.js"); // Configure the .env reader dotenv.config(); @@ -24,6 +25,7 @@ module.exports.suite = function suite() { const creds = new Credentials(USERNAME, PASSWORD); await creds.fetchToken(); await authenticate(creds); + await fetchPlatformData(); }); //#endregion Setup diff --git a/test/suites/searcher-test.js b/test/suites/searcher-test.js index 6b8aea4..ce6617f 100644 --- a/test/suites/searcher-test.js +++ b/test/suites/searcher-test.js @@ -7,9 +7,8 @@ const dotenv = require("dotenv"); // Modules from file const Credentials = require("../../app/scripts/classes/credentials.js"); const searcher = require("../../app/scripts/searcher.js"); -const { - authenticate -} = require("../../app/scripts/network-helper.js"); +const { authenticate } = require("../../app/scripts/network-helper.js"); +const { fetchPlatformData } = require("../../app/scripts/platform-data.js"); // Configure the .env reader dotenv.config(); @@ -59,6 +58,8 @@ module.exports.suite = function suite() { async function auth() { const creds = new Credentials(USERNAME, PASSWORD); await creds.fetchToken(); - return await authenticate(creds); + const result = await authenticate(creds); + if (result.success) await fetchPlatformData(); + return result; } //#endregion Private methods \ No newline at end of file diff --git a/test/suites/user-scraper-test.js b/test/suites/user-scraper-test.js index e3abe0e..650eaa9 100644 --- a/test/suites/user-scraper-test.js +++ b/test/suites/user-scraper-test.js @@ -7,9 +7,8 @@ const dotenv = require("dotenv"); // Modules from file const Credentials = require("../../app/scripts/classes/credentials.js"); const uScraper = require("../../app/scripts/user-scraper.js"); -const { - authenticate -} = require("../../app/scripts/network-helper.js"); +const { authenticate } = require("../../app/scripts/network-helper.js"); +const { fetchPlatformData } = require("../../app/scripts/platform-data.js"); // Configure the .env reader dotenv.config(); @@ -49,6 +48,8 @@ module.exports.suite = function suite() { async function auth() { const creds = new Credentials(USERNAME, PASSWORD); await creds.fetchToken(); - return await authenticate(creds); + const result = await authenticate(creds); + if (result.success) await fetchPlatformData(); + return result; } //#endregion Private methods \ No newline at end of file