Update test

pull/59/head
MillenniumEarl 2020-12-17 22:44:46 +01:00
parent d3a1a1e11a
commit 93ee130244
4 changed files with 13 additions and 9 deletions

View File

@ -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));

View File

@ -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

View File

@ -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

View File

@ -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