Skip to content

Commit

Permalink
Disable a brittle test
Browse files Browse the repository at this point in the history
  • Loading branch information
niekcandaele committed Sep 7, 2020
1 parent acabcf1 commit ab60b95
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions test/getStats.test.ts
@@ -1,21 +1,24 @@
'use strict';
import g from './_globals';
"use strict";
import * as chai from 'chai';
import { getStats } from '../lib/index';

describe('/api/getstats', async () => {
it('Returns expected info', async () => {
import { getStats } from '../lib';
import g from './_globals';

describe("/api/getstats", async () => {
it("Returns expected info", async () => {
const response = await getStats(g.getTestServer());
chai.expect(response.players).to.be.a('number');
chai.expect(response.animals).to.be.a('number');
chai.expect(response.hostiles).to.be.a('number');
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');
chai.expect(response.players).to.be.a("number");
chai.expect(response.animals).to.be.a("number");
chai.expect(response.hostiles).to.be.a("number");
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('Accepts extra options', async () => {
xit("Accepts extra options", async () => {
// If 7d2d server runs on same machine as you are running tests, this 1 ms timeout is sometimes not enough.
await chai.expect(getStats(g.getTestServer(), { timeout: 1 })).to.be.rejectedWith(Error);
await chai
.expect(getStats(g.getTestServer(), { timeout: 1 }))
.to.be.rejectedWith(Error);
});
});
});

0 comments on commit ab60b95

Please sign in to comment.