process rework, some tests and instant update

This commit is contained in:
2023-04-09 14:47:56 +02:00
parent 57c532c9bb
commit a297c86830
9 changed files with 438 additions and 312 deletions
+36
View File
@@ -28,6 +28,24 @@ describe('client', () => {
expect(first[1]).toHaveProperty('kills')
})
test('player list with weapon filter', async () => {
const request = await fetch("http://127.0.0.1:3000/players?weapons=sniper")
const data = await request.json()
const first = Object.entries(data)[0]
expect(first[1]).toHaveProperty('max_distance')
expect(first[1]).toHaveProperty('total_distance')
expect(first[1]).toHaveProperty('kills')
})
test('player list with weapon and server filter', async () => {
const request = await fetch("http://127.0.0.1:3000/players?weapons=sniper&server=1")
const data = await request.json()
const first = Object.entries(data)[0]
expect(first[1]).toHaveProperty('max_distance')
expect(first[1]).toHaveProperty('total_distance')
expect(first[1]).toHaveProperty('kills')
})
test('weapon list', async () => {
const request = await fetch("http://127.0.0.1:3000/weapons")
const data = await request.json()
@@ -36,6 +54,24 @@ describe('client', () => {
expect(first[1]).toHaveProperty('total_distance')
expect(first[1]).toHaveProperty('kills')
})
test('weapon list with player filter', async () => {
const request = await fetch("http://127.0.0.1:3000/weapons?players=1005930844007")
const data = await request.json()
const first = Object.entries(data)[0]
expect(first[1]).toHaveProperty('max_distance')
expect(first[1]).toHaveProperty('total_distance')
expect(first[1]).toHaveProperty('kills')
})
test('weapon list with player and server filter', async () => {
const request = await fetch("http://127.0.0.1:3000/weapons?players=1005930844007&server=1")
const data = await request.json()
const first = Object.entries(data)[0]
expect(first[1]).toHaveProperty('max_distance')
expect(first[1]).toHaveProperty('total_distance')
expect(first[1]).toHaveProperty('kills')
})
})
afterAll((done) => {