Update test
parent
d3a1a1e11a
commit
93ee130244
|
@ -11,7 +11,7 @@ const prefixParser = require("./suites/prefix-parser-test.js").suite;
|
||||||
|
|
||||||
describe("Test basic function", function testBasic() {
|
describe("Test basic function", function testBasic() {
|
||||||
//#region Set-up
|
//#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
|
//#endregion Set-up
|
||||||
|
|
||||||
describe("Test credentials class", credentials.bind(this));
|
describe("Test credentials class", credentials.bind(this));
|
||||||
|
|
|
@ -9,6 +9,7 @@ const { isEqual } = require("lodash");
|
||||||
const Credentials = require("../../app/scripts/classes/credentials.js");
|
const Credentials = require("../../app/scripts/classes/credentials.js");
|
||||||
const PrefixParser = require("../../app/scripts/classes/prefix-parser.js");
|
const PrefixParser = require("../../app/scripts/classes/prefix-parser.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
|
// Configure the .env reader
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
@ -24,6 +25,7 @@ module.exports.suite = function suite() {
|
||||||
const creds = new Credentials(USERNAME, PASSWORD);
|
const creds = new Credentials(USERNAME, PASSWORD);
|
||||||
await creds.fetchToken();
|
await creds.fetchToken();
|
||||||
await authenticate(creds);
|
await authenticate(creds);
|
||||||
|
await fetchPlatformData();
|
||||||
});
|
});
|
||||||
//#endregion Setup
|
//#endregion Setup
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,8 @@ const dotenv = require("dotenv");
|
||||||
// Modules from file
|
// Modules from file
|
||||||
const Credentials = require("../../app/scripts/classes/credentials.js");
|
const Credentials = require("../../app/scripts/classes/credentials.js");
|
||||||
const searcher = require("../../app/scripts/searcher.js");
|
const searcher = require("../../app/scripts/searcher.js");
|
||||||
const {
|
const { authenticate } = require("../../app/scripts/network-helper.js");
|
||||||
authenticate
|
const { fetchPlatformData } = require("../../app/scripts/platform-data.js");
|
||||||
} = require("../../app/scripts/network-helper.js");
|
|
||||||
|
|
||||||
// Configure the .env reader
|
// Configure the .env reader
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
@ -59,6 +58,8 @@ module.exports.suite = function suite() {
|
||||||
async function auth() {
|
async function auth() {
|
||||||
const creds = new Credentials(USERNAME, PASSWORD);
|
const creds = new Credentials(USERNAME, PASSWORD);
|
||||||
await creds.fetchToken();
|
await creds.fetchToken();
|
||||||
return await authenticate(creds);
|
const result = await authenticate(creds);
|
||||||
|
if (result.success) await fetchPlatformData();
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
//#endregion Private methods
|
//#endregion Private methods
|
|
@ -7,9 +7,8 @@ const dotenv = require("dotenv");
|
||||||
// Modules from file
|
// Modules from file
|
||||||
const Credentials = require("../../app/scripts/classes/credentials.js");
|
const Credentials = require("../../app/scripts/classes/credentials.js");
|
||||||
const uScraper = require("../../app/scripts/user-scraper.js");
|
const uScraper = require("../../app/scripts/user-scraper.js");
|
||||||
const {
|
const { authenticate } = require("../../app/scripts/network-helper.js");
|
||||||
authenticate
|
const { fetchPlatformData } = require("../../app/scripts/platform-data.js");
|
||||||
} = require("../../app/scripts/network-helper.js");
|
|
||||||
|
|
||||||
// Configure the .env reader
|
// Configure the .env reader
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
@ -49,6 +48,8 @@ module.exports.suite = function suite() {
|
||||||
async function auth() {
|
async function auth() {
|
||||||
const creds = new Credentials(USERNAME, PASSWORD);
|
const creds = new Credentials(USERNAME, PASSWORD);
|
||||||
await creds.fetchToken();
|
await creds.fetchToken();
|
||||||
return await authenticate(creds);
|
const result = await authenticate(creds);
|
||||||
|
if (result.success) await fetchPlatformData();
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
//#endregion Private methods
|
//#endregion Private methods
|
Loading…
Reference in New Issue