Skip to content

Commit

Permalink
getStats code only 2 test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
niekcandaele committed Jun 22, 2018
1 parent ab1d43d commit 1a74baf
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions test/getStats.test.ts
Expand Up @@ -23,27 +23,16 @@ let badTestServer: SdtdServer = {
}

describe('/api/getstats', async () => {
it('Returns players info', async () => {
it('Returns expected info', async () => {
let response = await SdtdApi.getStats(testServer);
chai.expect(response.players).to.be.a('number');
});

it('Returns animals info', async () => {
let response = await SdtdApi.getStats(testServer);
chai.expect(response.animals).to.be.a('number');
});

it('Returns hostiles info', async () => {
let response = await SdtdApi.getStats(testServer);
chai.expect(response.hostiles).to.be.a('number');
});

it('Returns game time info', async () => {
let response = await SdtdApi.getStats(testServer);
chai.expect(response.gametime.days).to.be.a('number');
chai.expect(response.gametime.hours).to.be.a('number');
chai.expect(response.gametime.minutes).to.be.a('number');
});

it('Errors when incorrect server info is given', async () => {
return chai.expect(SdtdApi.getStats(badTestServer)).to.be.rejectedWith(Error);
});
Expand Down

0 comments on commit 1a74baf

Please sign in to comment.