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
*
@ -14,6 +16,7 @@ const apiVersion = '1.2.14';
describe(__filename, function () {
describe('Connectivity for instance-level API tests', function () {
it('can connect', function (done) {
this.timeout(150);
api.get('/api/')
.expect('Content-Type', /json/)
.expect(200, done);
@ -22,6 +25,7 @@ describe(__filename, function () {
describe('getStats', function () {
it('Gets the stats of a running instance', function (done) {
this.timeout(100);
api.get(endPoint('getStats'))
.expect((res) => {
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;
return `/api/${version}/${point}?apikey=${apiKey}`;
};