lint and timeouts for instance.js

mochawesome
John McLear 2021-01-27 20:45:23 +00:00
parent 8fff1db4d0
commit e5d80a0696
1 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,5 @@
'use strict';
/* /*
* Tests for the instance-level APIs * Tests for the instance-level APIs
* *
@ -14,6 +16,7 @@ const apiVersion = '1.2.14';
describe(__filename, function () { describe(__filename, function () {
describe('Connectivity for instance-level API tests', function () { describe('Connectivity for instance-level API tests', function () {
it('can connect', function (done) { it('can connect', function (done) {
this.timeout(150);
api.get('/api/') api.get('/api/')
.expect('Content-Type', /json/) .expect('Content-Type', /json/)
.expect(200, done); .expect(200, done);
@ -22,6 +25,7 @@ describe(__filename, function () {
describe('getStats', function () { describe('getStats', function () {
it('Gets the stats of a running instance', function (done) { it('Gets the stats of a running instance', function (done) {
this.timeout(100);
api.get(endPoint('getStats')) api.get(endPoint('getStats'))
.expect((res) => { .expect((res) => {
if (res.body.code !== 0) throw new Error('getStats() failed'); if (res.body.code !== 0) throw new Error('getStats() failed');
@ -44,7 +48,7 @@ describe(__filename, function () {
}); });
}); });
var endPoint = function (point, version) { const endPoint = function (point, version) {
version = version || apiVersion; version = version || apiVersion;
return `/api/${version}/${point}?apikey=${apiKey}`; return `/api/${version}/${point}?apikey=${apiKey}`;
}; };