mirror of
https://github.com/maxswa/osrs-json-hiscores.git
synced 2025-10-15 10:19:04 +00:00
Fix tests.
This commit is contained in:
@@ -31,7 +31,9 @@ const b0atyStatsCsv = readFileSync(`${__dirname}/b0atyStats.csv`, 'utf8');
|
||||
const b0atyStatsJson: HiscoresResponse = JSON.parse(
|
||||
readFileSync(`${__dirname}/b0atyStats.json`, 'utf8')
|
||||
);
|
||||
const lynxTitanStats = readFileSync(`${__dirname}/lynxTitanStats.csv`, 'utf8');
|
||||
const lynxTitanStats = JSON.parse(
|
||||
readFileSync(`${__dirname}/lynxTitanStats.json`, 'utf8')
|
||||
);
|
||||
const lynxTitanNamePage = readFileSync(
|
||||
`${__dirname}/lynxTitanNamePage.html`,
|
||||
'utf8'
|
||||
@@ -52,7 +54,7 @@ jest.spyOn(axios, 'get').mockImplementation((url) => {
|
||||
if (getSkillPageURL('main', 'attack', 1) === url) {
|
||||
return Promise.resolve({ data: attackTopPage });
|
||||
}
|
||||
if (getStatsURL('main', LYNX_TITAN_FORMATTED_NAME) === url) {
|
||||
if (getStatsURL('main', LYNX_TITAN_FORMATTED_NAME, true) === url) {
|
||||
return Promise.resolve({ status: 200, data: lynxTitanStats });
|
||||
}
|
||||
throw new Error(`No mock response for URL: ${url}`);
|
||||
@@ -553,11 +555,11 @@ describe('Get stats options', () => {
|
||||
it('fetches all gamemodes and formatted RSN when no options provided', async () => {
|
||||
await getStats(rsn);
|
||||
expect(axiosMock.mock.calls.map((val) => val[0])).toEqual([
|
||||
getStatsURL('main', rsn),
|
||||
getStatsURL('main', rsn, true),
|
||||
getPlayerTableURL('main', rsn),
|
||||
getStatsURL('ironman', rsn),
|
||||
getStatsURL('hardcore', rsn),
|
||||
getStatsURL('ultimate', rsn)
|
||||
getStatsURL('ironman', rsn, true),
|
||||
getStatsURL('hardcore', rsn, true),
|
||||
getStatsURL('ultimate', rsn, true)
|
||||
]);
|
||||
});
|
||||
it('skips fetching formatted RSN when option is provided', async () => {
|
||||
|
@@ -1,98 +0,0 @@
|
||||
1,2277,4600000000
|
||||
15,99,200000000
|
||||
28,99,200000000
|
||||
18,99,200000000
|
||||
7,99,200000000
|
||||
8,99,200000000
|
||||
11,99,200000000
|
||||
32,99,200000000
|
||||
157,99,200000000
|
||||
15,99,200000000
|
||||
12,99,200000000
|
||||
9,99,200000000
|
||||
48,99,200000000
|
||||
4,99,200000000
|
||||
3,99,200000000
|
||||
25,99,200000000
|
||||
5,99,200000000
|
||||
24,99,200000000
|
||||
12,99,200000000
|
||||
2,99,200000000
|
||||
19,99,200000000
|
||||
7,99,200000000
|
||||
4,99,200000000
|
||||
4,99,200000000
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
764013,22
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
480246,22
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
196,186
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
||||
-1,-1
|
Can't render this file because it has a wrong number of fields in line 25.
|
147
__tests__/lynxTitanStats.json
Normal file
147
__tests__/lynxTitanStats.json
Normal file
@@ -0,0 +1,147 @@
|
||||
{
|
||||
"skills": [
|
||||
{ "id": 0, "name": "Overall", "rank": 1, "level": 2277, "xp": 4600000000 },
|
||||
{ "id": 1, "name": "Attack", "rank": 15, "level": 99, "xp": 200000000 },
|
||||
{ "id": 2, "name": "Defence", "rank": 28, "level": 99, "xp": 200000000 },
|
||||
{ "id": 3, "name": "Strength", "rank": 18, "level": 99, "xp": 200000000 },
|
||||
{ "id": 4, "name": "Hitpoints", "rank": 7, "level": 99, "xp": 200000000 },
|
||||
{ "id": 5, "name": "Ranged", "rank": 8, "level": 99, "xp": 200000000 },
|
||||
{ "id": 6, "name": "Prayer", "rank": 11, "level": 99, "xp": 200000000 },
|
||||
{ "id": 7, "name": "Magic", "rank": 32, "level": 99, "xp": 200000000 },
|
||||
{ "id": 8, "name": "Cooking", "rank": 157, "level": 99, "xp": 200000000 },
|
||||
{
|
||||
"id": 9,
|
||||
"name": "Woodcutting",
|
||||
"rank": 15,
|
||||
"level": 99,
|
||||
"xp": 200000000
|
||||
},
|
||||
{ "id": 10, "name": "Fletching", "rank": 12, "level": 99, "xp": 200000000 },
|
||||
{ "id": 11, "name": "Fishing", "rank": 9, "level": 99, "xp": 200000000 },
|
||||
{
|
||||
"id": 12,
|
||||
"name": "Firemaking",
|
||||
"rank": 48,
|
||||
"level": 99,
|
||||
"xp": 200000000
|
||||
},
|
||||
{ "id": 13, "name": "Crafting", "rank": 4, "level": 99, "xp": 200000000 },
|
||||
{ "id": 14, "name": "Smithing", "rank": 3, "level": 99, "xp": 200000000 },
|
||||
{ "id": 15, "name": "Mining", "rank": 25, "level": 99, "xp": 200000000 },
|
||||
{ "id": 16, "name": "Herblore", "rank": 5, "level": 99, "xp": 200000000 },
|
||||
{ "id": 17, "name": "Agility", "rank": 24, "level": 99, "xp": 200000000 },
|
||||
{ "id": 18, "name": "Thieving", "rank": 12, "level": 99, "xp": 200000000 },
|
||||
{ "id": 19, "name": "Slayer", "rank": 2, "level": 99, "xp": 200000000 },
|
||||
{ "id": 20, "name": "Farming", "rank": 19, "level": 99, "xp": 200000000 },
|
||||
{ "id": 21, "name": "Runecraft", "rank": 7, "level": 99, "xp": 200000000 },
|
||||
{ "id": 22, "name": "Hunter", "rank": 4, "level": 99, "xp": 200000000 },
|
||||
{
|
||||
"id": 23,
|
||||
"name": "Construction",
|
||||
"rank": 4,
|
||||
"level": 99,
|
||||
"xp": 200000000
|
||||
}
|
||||
],
|
||||
"activities": [
|
||||
{ "id": 0, "name": "League Points", "rank": -1, "score": -1 },
|
||||
{ "id": 1, "name": "Bounty Hunter - Hunter", "rank": -1, "score": -1 },
|
||||
{ "id": 2, "name": "Bounty Hunter - Rogue", "rank": -1, "score": -1 },
|
||||
{
|
||||
"id": 3,
|
||||
"name": "Bounty Hunter (Legacy) - Hunter",
|
||||
"rank": -1,
|
||||
"score": -1
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"name": "Bounty Hunter (Legacy) - Rogue",
|
||||
"rank": -1,
|
||||
"score": -1
|
||||
},
|
||||
{ "id": 5, "name": "Clue Scrolls (all)", "rank": 769527, "score": 22 },
|
||||
{ "id": 6, "name": "Clue Scrolls (beginner)", "rank": -1, "score": -1 },
|
||||
{ "id": 7, "name": "Clue Scrolls (easy)", "rank": -1, "score": -1 },
|
||||
{ "id": 8, "name": "Clue Scrolls (medium)", "rank": -1, "score": -1 },
|
||||
{ "id": 9, "name": "Clue Scrolls (hard)", "rank": 483333, "score": 22 },
|
||||
{ "id": 10, "name": "Clue Scrolls (elite)", "rank": -1, "score": -1 },
|
||||
{ "id": 11, "name": "Clue Scrolls (master)", "rank": -1, "score": -1 },
|
||||
{ "id": 12, "name": "LMS - Rank", "rank": -1, "score": -1 },
|
||||
{ "id": 13, "name": "PvP Arena - Rank", "rank": -1, "score": -1 },
|
||||
{ "id": 14, "name": "Soul Wars Zeal", "rank": -1, "score": -1 },
|
||||
{ "id": 15, "name": "Rifts closed", "rank": -1, "score": -1 },
|
||||
{ "id": 16, "name": "Abyssal Sire", "rank": -1, "score": -1 },
|
||||
{ "id": 17, "name": "Alchemical Hydra", "rank": -1, "score": -1 },
|
||||
{ "id": 18, "name": "Artio", "rank": -1, "score": -1 },
|
||||
{ "id": 19, "name": "Barrows Chests", "rank": -1, "score": -1 },
|
||||
{ "id": 20, "name": "Bryophyta", "rank": -1, "score": -1 },
|
||||
{ "id": 21, "name": "Callisto", "rank": -1, "score": -1 },
|
||||
{ "id": 22, "name": "Calvar'ion", "rank": -1, "score": -1 },
|
||||
{ "id": 23, "name": "Cerberus", "rank": -1, "score": -1 },
|
||||
{ "id": 24, "name": "Chambers of Xeric", "rank": -1, "score": -1 },
|
||||
{
|
||||
"id": 25,
|
||||
"name": "Chambers of Xeric: Challenge Mode",
|
||||
"rank": -1,
|
||||
"score": -1
|
||||
},
|
||||
{ "id": 26, "name": "Chaos Elemental", "rank": -1, "score": -1 },
|
||||
{ "id": 27, "name": "Chaos Fanatic", "rank": -1, "score": -1 },
|
||||
{ "id": 28, "name": "Commander Zilyana", "rank": -1, "score": -1 },
|
||||
{ "id": 29, "name": "Corporeal Beast", "rank": -1, "score": -1 },
|
||||
{ "id": 30, "name": "Crazy Archaeologist", "rank": -1, "score": -1 },
|
||||
{ "id": 31, "name": "Dagannoth Prime", "rank": -1, "score": -1 },
|
||||
{ "id": 32, "name": "Dagannoth Rex", "rank": -1, "score": -1 },
|
||||
{ "id": 33, "name": "Dagannoth Supreme", "rank": -1, "score": -1 },
|
||||
{ "id": 34, "name": "Deranged Archaeologist", "rank": -1, "score": -1 },
|
||||
{ "id": 35, "name": "Duke Sucellus", "rank": -1, "score": -1 },
|
||||
{ "id": 36, "name": "General Graardor", "rank": -1, "score": -1 },
|
||||
{ "id": 37, "name": "Giant Mole", "rank": -1, "score": -1 },
|
||||
{ "id": 38, "name": "Grotesque Guardians", "rank": -1, "score": -1 },
|
||||
{ "id": 39, "name": "Hespori", "rank": -1, "score": -1 },
|
||||
{ "id": 40, "name": "Kalphite Queen", "rank": -1, "score": -1 },
|
||||
{ "id": 41, "name": "King Black Dragon", "rank": -1, "score": -1 },
|
||||
{ "id": 42, "name": "Kraken", "rank": -1, "score": -1 },
|
||||
{ "id": 43, "name": "Kree'Arra", "rank": -1, "score": -1 },
|
||||
{ "id": 44, "name": "K'ril Tsutsaroth", "rank": -1, "score": -1 },
|
||||
{ "id": 45, "name": "Mimic", "rank": -1, "score": -1 },
|
||||
{ "id": 46, "name": "Nex", "rank": -1, "score": -1 },
|
||||
{ "id": 47, "name": "Nightmare", "rank": -1, "score": -1 },
|
||||
{ "id": 48, "name": "Phosani's Nightmare", "rank": -1, "score": -1 },
|
||||
{ "id": 49, "name": "Obor", "rank": -1, "score": -1 },
|
||||
{ "id": 50, "name": "Phantom Muspah", "rank": -1, "score": -1 },
|
||||
{ "id": 51, "name": "Sarachnis", "rank": -1, "score": -1 },
|
||||
{ "id": 52, "name": "Scorpia", "rank": -1, "score": -1 },
|
||||
{ "id": 53, "name": "Skotizo", "rank": -1, "score": -1 },
|
||||
{ "id": 54, "name": "Spindel", "rank": -1, "score": -1 },
|
||||
{ "id": 55, "name": "Tempoross", "rank": -1, "score": -1 },
|
||||
{ "id": 56, "name": "The Gauntlet", "rank": -1, "score": -1 },
|
||||
{ "id": 57, "name": "The Corrupted Gauntlet", "rank": -1, "score": -1 },
|
||||
{ "id": 58, "name": "The Leviathan", "rank": -1, "score": -1 },
|
||||
{ "id": 59, "name": "The Whisperer", "rank": -1, "score": -1 },
|
||||
{ "id": 60, "name": "Theatre of Blood", "rank": -1, "score": -1 },
|
||||
{
|
||||
"id": 61,
|
||||
"name": "Theatre of Blood: Hard Mode",
|
||||
"rank": -1,
|
||||
"score": -1
|
||||
},
|
||||
{ "id": 62, "name": "Thermonuclear Smoke Devil", "rank": -1, "score": -1 },
|
||||
{ "id": 63, "name": "Tombs of Amascut", "rank": -1, "score": -1 },
|
||||
{
|
||||
"id": 64,
|
||||
"name": "Tombs of Amascut: Expert Mode",
|
||||
"rank": -1,
|
||||
"score": -1
|
||||
},
|
||||
{ "id": 65, "name": "TzKal-Zuk", "rank": -1, "score": -1 },
|
||||
{ "id": 66, "name": "TzTok-Jad", "rank": 198, "score": 186 },
|
||||
{ "id": 67, "name": "Vardorvis", "rank": -1, "score": -1 },
|
||||
{ "id": 68, "name": "Venenatis", "rank": -1, "score": -1 },
|
||||
{ "id": 69, "name": "Vet'ion", "rank": -1, "score": -1 },
|
||||
{ "id": 70, "name": "Vorkath", "rank": -1, "score": -1 },
|
||||
{ "id": 71, "name": "Wintertodt", "rank": -1, "score": -1 },
|
||||
{ "id": 72, "name": "Zalcano", "rank": -1, "score": -1 },
|
||||
{ "id": 73, "name": "Zulrah", "rank": -1, "score": -1 }
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user