finishing tests for v2

This commit is contained in:
2023-04-25 13:06:45 +02:00
parent e9277c3862
commit bd023aac45
5 changed files with 81 additions and 56 deletions
+42 -34
View File
@@ -65,15 +65,17 @@ describe('server', () => {
attacker_weapon_1_mods: 0,
victim_id: '0',
victim_name: 'TestVictim',
victim_offhand_weapon_2: 0,
attacker_offhand_weapon_3: '0',
victim_offhand_weapon_2: 'offhand_weapon_test',
victim_offhand_weapon_2_mods: 0,
victim_weapon_3_mods: 0,
attacker_weapon_2_mods: 0,
attacker_offhand_weapon_1: 0,
attacker_offhand_weapon_1: 'offhand_weapon_test',
attacker_offhand_weapon_1_mods: 0,
attacker_weapon_3_mods: 0,
attacker_offhand_weapon_2: 0,
victim_offhand_weapon_3: '0',
victim_offhand_weapon_1: 0,
attacker_offhand_weapon_2: 'offhand_weapon_test',
attacker_offhand_weapon_2_mods: 0,
victim_offhand_weapon_1: 'offhand_weapon_test',
victim_offhand_weapon_1_mods: 0,
attacker_weapon_3: 'defender',
killstat_version: 'ks_3.0.0',
attacker_weapon_1: 'smr',
@@ -95,7 +97,9 @@ describe('server', () => {
victim_weapon_2: 'autopistol',
victim_weapon_1_mods: 0,
victim_weapon_3: 'defender',
attacker_name: 'TestAttacker'
attacker_name: 'TestAttacker',
victim_titan: 'null',
attacker_titan: 'null'
}
const response = await fetch(`http://127.0.0.1:3001/kill`, {
method: "POST", // *GET, POST, PUT, DELETE, etc.
@@ -114,40 +118,44 @@ describe('server', () => {
test('register a kill with missing data', async () => {
const data = {
servername: 'testserver',
attacker_weapon_1_mods: NaN,
attacker_weapon_1_mods: 0,
victim_id: '0',
victim_name: 'TestVictim',
victim_offhand_weapon_2: NaN,
attacker_offhand_weapon_3: 'null',
victim_weapon_3_mods: 19,
victim_offhand_weapon_2: 'null',
victim_offhand_weapon_2_mods: 0,
victim_weapon_3_mods: 0,
attacker_weapon_2_mods: NaN,
attacker_offhand_weapon_1: NaN,
attacker_offhand_weapon_1: 'null',
attacker_offhand_weapon_1_mods: 0,
attacker_weapon_3_mods: NaN,
attacker_offhand_weapon_2: NaN,
victim_offhand_weapon_3: '0',
victim_offhand_weapon_1: 1,
attacker_weapon_3: 'null',
attacker_offhand_weapon_2: 'null',
attacker_offhand_weapon_2_mods: NaN,
victim_offhand_weapon_1: 'offhand_weapon_test',
victim_offhand_weapon_1_mods: 0,
attacker_weapon_3: 'defender',
killstat_version: 'ks_3.0.0',
attacker_weapon_1: 'null',
match_id: '554fa7a3',
distance: 202,
victim_current_weapon: 'car',
cause_of_death: 'satchel',
victim_weapon_2_mods: NaN,
victim_current_weapon_mods: NaN,
attacker_current_weapon_mods: NaN,
game_time: 516.417,
player_count: 13,
attacker_current_weapon: 'null',
attacker_weapon_1: 'smr',
match_id: '31b1f34d',
distance: 0,
victim_current_weapon: 'smr',
cause_of_death: 'smr',
victim_weapon_2_mods: 0,
victim_current_weapon_mods: 0,
attacker_current_weapon_mods: 0,
game_time: 377.799,
player_count: 1,
attacker_current_weapon: 'smr',
attacker_id: '1',
game_mode: 'ps',
map: 'grave',
attacker_weapon_2: 'null',
victim_weapon_1: 'car',
game_mode: 'tdm',
map: 'thaw',
attacker_weapon_2: 'autopistol',
victim_weapon_1: 'null',
victim_weapon_2: 'autopistol',
victim_weapon_1_mods: NaN,
victim_weapon_3: 'arc_launcher',
attacker_name: 'TestAttacker'
victim_weapon_1_mods: 0,
victim_weapon_3: 'defender',
attacker_name: 'TestAttacker',
victim_titan: 'null',
attacker_titan: 'null'
}
const response = await fetch(`http://127.0.0.1:3001/kill`, {
method: "POST", // *GET, POST, PUT, DELETE, etc.