mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
fix lint.
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { expect } from "chai"
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"./scriptSandbox"' has no exported member ... Remove this comment to see the full error message
|
||||
import { runScript } from "./scriptSandbox"
|
||||
import axios from 'axios';
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('ScriptMonitor V2', function(this: $TSFixMe) {
|
||||
describe('ScriptMonitor V2', function() {
|
||||
this.timeout(10000);
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe("runScript function", function(){
|
||||
@@ -28,14 +29,10 @@ describe('ScriptMonitor V2', function(this: $TSFixMe) {
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it("should return success for a valid script", async function() {
|
||||
const someFunction = async (done: $TSFixMe) => {
|
||||
// make api requests using "axios" or "request"
|
||||
const axios = require("axios").default;
|
||||
// import request from "request-promise"
|
||||
|
||||
|
||||
|
||||
const res = await axios.get("http://localhost:5050/test");
|
||||
// const res = await request.get("http://localhost:5050/test");
|
||||
console.log("hello");
|
||||
console.log("world!");
|
||||
|
||||
done();
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@ import AirtableService from '../backend/services/airtableService'
|
||||
let token;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Admin process.env login API', function(this: $TSFixMe) {
|
||||
describe('Admin process.env login API', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(40000);
|
||||
await UserService.hardDeleteBy({});
|
||||
await GlobalConfig.initTestConfig();
|
||||
|
||||
@@ -6,7 +6,7 @@ import userData from './data/user'
|
||||
import incidentData from './data/incident'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -40,11 +40,11 @@ describe('Alert API', function() {
|
||||
await UserService.hardDeleteBy({});
|
||||
});
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Alert API without subprojects', function(this: $TSFixMe) {
|
||||
describe('Alert API without subprojects', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(30000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
@@ -200,10 +200,10 @@ describe('Alert API', function() {
|
||||
let newUserToken: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Alert API with Sub-Projects', function(this: $TSFixMe) {
|
||||
describe('Alert API with Sub-Projects', function() {
|
||||
this.timeout(40000);
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(30000);
|
||||
const authorization = `Basic ${token}`;
|
||||
// create a subproject for parent project
|
||||
|
||||
@@ -31,11 +31,11 @@ const logCount = {
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Application Log API', function(this: $TSFixMe) {
|
||||
describe('Application Log API', function() {
|
||||
this.timeout(80000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(90000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -23,7 +23,7 @@ import ApplicationSecurityLogService from '../backend/services/applicationSecuri
|
||||
import AirtableService from '../backend/services/airtableService'
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Application Security API', function(this: $TSFixMe) {
|
||||
describe('Application Security API', function() {
|
||||
const timeout = 300000;
|
||||
let projectId: $TSFixMe,
|
||||
componentId: $TSFixMe,
|
||||
@@ -201,7 +201,7 @@ describe('Application Security API', function(this: $TSFixMe) {
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should scan an application security', function(this: $TSFixMe, done: $TSFixMe) {
|
||||
it('should scan an application security', function( done: $TSFixMe) {
|
||||
this.timeout(300000);
|
||||
const authorization = `Basic ${token}`;
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@ let token: $TSFixMe, projectId: $TSFixMe, userId: $TSFixMe;
|
||||
let testSuiteStartTime: $TSFixMe, testCaseStartTime: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Audit Logs API', function(this: $TSFixMe) {
|
||||
describe('Audit Logs API', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
testSuiteStartTime = new Date();
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
|
||||
@@ -31,11 +31,11 @@ let token: $TSFixMe,
|
||||
resourceCount = 0;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Component API', function(this: $TSFixMe) {
|
||||
describe('Component API', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(80000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
@@ -395,10 +395,10 @@ let subProjectId: $TSFixMe,
|
||||
newComponentId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Component API with Sub-Projects', function(this: $TSFixMe) {
|
||||
describe('Component API with Sub-Projects', function() {
|
||||
this.timeout(30000);
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(30000);
|
||||
const authorization = `Basic ${token}`;
|
||||
// create a subproject for parent project
|
||||
|
||||
@@ -23,7 +23,7 @@ import ContainerSecurityLogService from '../backend/services/containerSecurityLo
|
||||
import AirtableService from '../backend/services/airtableService'
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Container Security API', function(this: $TSFixMe) {
|
||||
describe('Container Security API', function() {
|
||||
const timeout = 30000;
|
||||
let projectId: $TSFixMe,
|
||||
componentId: $TSFixMe,
|
||||
@@ -197,7 +197,7 @@ describe('Container Security API', function(this: $TSFixMe) {
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should scan a container security', function(this: $TSFixMe, done: $TSFixMe) {
|
||||
it('should scan a container security', function( done: $TSFixMe) {
|
||||
this.timeout(300000);
|
||||
const authorization = `Basic ${token}`;
|
||||
|
||||
@@ -213,7 +213,7 @@ describe('Container Security API', function(this: $TSFixMe) {
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should throw error if scanning with an invalid docker credentials or invalid image path', function(this: $TSFixMe, done: $TSFixMe) {
|
||||
it('should throw error if scanning with an invalid docker credentials or invalid image path', function( done: $TSFixMe) {
|
||||
this.timeout(500000);
|
||||
const authorization = `Basic ${token}`;
|
||||
const data = {
|
||||
|
||||
@@ -20,7 +20,7 @@ import ComponentService from '../backend/services/componentService'
|
||||
import IncidentCustomFieldService from '../backend/services/customFieldService'
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Incident Custom Field API', function(this: $TSFixMe) {
|
||||
describe('Incident Custom Field API', function() {
|
||||
const timeout = 30000;
|
||||
let projectId: $TSFixMe, userId, token, authorization: $TSFixMe, customFieldId: $TSFixMe;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import DockerCredentialService from '../backend/services/dockerCredentialService
|
||||
import AirtableService from '../backend/services/airtableService'
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Docker Credential API', function(this: $TSFixMe) {
|
||||
describe('Docker Credential API', function() {
|
||||
const timeout = 30000;
|
||||
let projectId: $TSFixMe, userId, token: $TSFixMe, credentialId: $TSFixMe;
|
||||
const dockerRegistryUrl = dockerCredential.dockerRegistryUrl;
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import EmailStatusService from '../backend/services/emailStatusService'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -25,11 +25,11 @@ const selectEmailStatus =
|
||||
'from to subject body createdAt template status content error deleted deletedAt deletedById replyTo smtpServer';
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Email verification API', function(this: $TSFixMe) {
|
||||
describe('Email verification API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
GlobalConfig.enableEmailLog().then(function() {
|
||||
|
||||
@@ -21,11 +21,11 @@ let token: $TSFixMe, projectId: $TSFixMe, userId: $TSFixMe;
|
||||
let testSuiteStartTime: $TSFixMe, testCaseStartTime: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Email Logs API', function(this: $TSFixMe) {
|
||||
describe('Email Logs API', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
testSuiteStartTime = new Date();
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import data from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -23,11 +23,11 @@ import smtpCredential from './data/smtpCredential'
|
||||
let projectId: $TSFixMe, jwtToken: $TSFixMe, emailSmtpId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Email SMTP Api Test', function(this: $TSFixMe) {
|
||||
describe('Email SMTP Api Test', function() {
|
||||
this.timeout(200000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(400000);
|
||||
await GlobalConfig.initTestConfig();
|
||||
const res = await createUser(request, data.user);
|
||||
|
||||
@@ -4,7 +4,7 @@ process.env.PORT = 3020;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -21,11 +21,11 @@ import AirtableService from '../backend/services/airtableService'
|
||||
let token: $TSFixMe, projectId: $TSFixMe, emailTemplateId: $TSFixMe, userId;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Email Template API', function(this: $TSFixMe) {
|
||||
describe('Email Template API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(40000);
|
||||
await GlobalConfig.initTestConfig();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import userData from './data/user'
|
||||
import incidentData from './data/incident'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -22,11 +22,11 @@ import ComponentModel from '../backend/models/component'
|
||||
let token: $TSFixMe, projectId: $TSFixMe, monitorId: $TSFixMe, incidentId: $TSFixMe, alertId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Enterprise Alert API', function(this: $TSFixMe) {
|
||||
describe('Enterprise Alert API', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createEnterpriseUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -18,11 +18,11 @@ import ComponentService from '../backend/services/componentService'
|
||||
let token: $TSFixMe, projectId: $TSFixMe, newProjectId: $TSFixMe, componentId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Enterprise Component API', function(this: $TSFixMe) {
|
||||
describe('Enterprise Component API', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createEnterpriseUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import data from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -15,10 +15,10 @@ import UserService from '../backend/services/userService'
|
||||
import ProjectService from '../backend/services/projectService'
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Disable Sign up test', function(this: $TSFixMe) {
|
||||
describe('Disable Sign up test', function() {
|
||||
this.timeout(200000);
|
||||
let token: $TSFixMe = null;
|
||||
this.beforeAll(async function(this: $TSFixMe) {
|
||||
this.beforeAll(async function() {
|
||||
this.timeout(400000);
|
||||
await GlobalConfig.removeTestConfig();
|
||||
await UserService.hardDeleteBy({});
|
||||
|
||||
@@ -41,11 +41,11 @@ const sleep = (waitTimeInMs: $TSFixMe) => new Promise(resolve => setTimeout(reso
|
||||
let authorization: $TSFixMe, token, userId: $TSFixMe, projectId: $TSFixMe, componentId, monitorId: $TSFixMe, scheduleId;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Incident Alerts', function(this: $TSFixMe) {
|
||||
describe('Incident Alerts', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(30000);
|
||||
GlobalConfig.initTestConfig().then(() => {
|
||||
createEnterpriseUser(request, userData.user, async function(
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -20,11 +20,11 @@ import ComponentModel from '../backend/models/component'
|
||||
let token: $TSFixMe, projectId: $TSFixMe, newProjectId: $TSFixMe, monitorId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Enterprise Monitor API', function(this: $TSFixMe) {
|
||||
describe('Enterprise Monitor API', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createEnterpriseUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -17,11 +17,11 @@ import ProjectService from '../backend/services/projectService'
|
||||
let token: $TSFixMe, projectId: $TSFixMe, newProjectId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Enterprise Project API', function(this: $TSFixMe) {
|
||||
describe('Enterprise Project API', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createEnterpriseUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -19,11 +19,11 @@ let token: $TSFixMe, projectId: $TSFixMe, newProjectId: $TSFixMe;
|
||||
const teamEmail = 'noreply1@oneuptime.com';
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Enterprise Team API', function(this: $TSFixMe) {
|
||||
describe('Enterprise Team API', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createEnterpriseUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import data from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -17,11 +17,11 @@ import ProjectService from '../backend/services/projectService'
|
||||
let projectId: $TSFixMe, newProjectId: $TSFixMe, userRole: $TSFixMe, token: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Enterprise User API', function(this: $TSFixMe) {
|
||||
describe('Enterprise User API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createEnterpriseUser(request, data.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -25,11 +25,11 @@ let token: $TSFixMe,
|
||||
const sampleErrorEvent = {};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Error Tracker API', function(this: $TSFixMe) {
|
||||
describe('Error Tracker API', function() {
|
||||
this.timeout(80000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(95000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import EmailStatusService from '../backend/services/emailStatusService'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -23,11 +23,11 @@ const selectEmailStatus =
|
||||
let token: $TSFixMe, projectId: $TSFixMe, userId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Feedback API', function(this: $TSFixMe) {
|
||||
describe('Feedback API', function() {
|
||||
this.timeout(50000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
GlobalConfig.enableEmailLog().then(function() {
|
||||
|
||||
@@ -19,7 +19,7 @@ import GitCredentialService from '../backend/services/gitCredentialService'
|
||||
import AirtableService from '../backend/services/airtableService'
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Git Credential API', function(this: $TSFixMe) {
|
||||
describe('Git Credential API', function() {
|
||||
const timeout = 30000;
|
||||
let projectId: $TSFixMe, userId, token: $TSFixMe, credentialId: $TSFixMe;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import data from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -20,11 +20,11 @@ import GlobalConfig from './utils/globalConfig'
|
||||
let projectId: $TSFixMe, userId: $TSFixMe, token: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Global Config API', function(this: $TSFixMe) {
|
||||
describe('Global Config API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(100000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, data.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -68,10 +68,10 @@ const testServerMonitor = {
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Incident API', function(this: $TSFixMe) {
|
||||
describe('Incident API', function() {
|
||||
this.timeout(500000);
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(90000);
|
||||
await GlobalConfig.initTestConfig();
|
||||
const res = await createUser(request, userData.user);
|
||||
@@ -715,10 +715,10 @@ describe('Incident API', function(this: $TSFixMe) {
|
||||
let subProjectId: $TSFixMe, newUserToken: $TSFixMe, subProjectIncidentId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Incident API with Sub-Projects', function(this: $TSFixMe) {
|
||||
describe('Incident API with Sub-Projects', function() {
|
||||
this.timeout(60000);
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(60000);
|
||||
|
||||
incidentData.monitors = [monitorId];
|
||||
|
||||
@@ -71,11 +71,11 @@ const sleep = (waitTimeInMs: $TSFixMe) => new Promise(resolve => setTimeout(reso
|
||||
let authorization: $TSFixMe, userId: $TSFixMe, projectId: $TSFixMe, componentId: $TSFixMe, monitorId: $TSFixMe, scheduleId;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('SMS/Calls Incident Alerts', function(this: $TSFixMe) {
|
||||
describe('SMS/Calls Incident Alerts', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(30000);
|
||||
await GlobalConfig.initTestConfig();
|
||||
const user = await createUser(request, userData.user);
|
||||
@@ -887,7 +887,7 @@ describe('SMS/Calls Incident Alerts', function(this: $TSFixMe) {
|
||||
* SMS/Call alerts enabled for the project (billing): true
|
||||
*/
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should notify the team set for a schedule, which is associated with a monitor criteriad', async function(this: $TSFixMe) {
|
||||
it('should notify the team set for a schedule, which is associated with a monitor criteriad', async function() {
|
||||
/*
|
||||
* run the probe server for this test
|
||||
*/
|
||||
@@ -1038,7 +1038,7 @@ describe('SMS/Calls Incident Alerts', function(this: $TSFixMe) {
|
||||
.is.true;
|
||||
});
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should notify the team set for a schedule, which is associated with a monitor criteria (incomingHttp monitor)', async function(this: $TSFixMe) {
|
||||
it('should notify the team set for a schedule, which is associated with a monitor criteria (incomingHttp monitor)', async function() {
|
||||
/*
|
||||
* run the probe server for this test
|
||||
*/
|
||||
@@ -1207,7 +1207,7 @@ describe('SMS/Calls Incident Alerts', function(this: $TSFixMe) {
|
||||
* SMS/Call alerts enabled for the project (billing): true
|
||||
*/
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should use default criterion if no criterion is matched for an incident', async function(this: $TSFixMe) {
|
||||
it('should use default criterion if no criterion is matched for an incident', async function() {
|
||||
/*
|
||||
* run the probe server for this test
|
||||
*/
|
||||
@@ -2102,7 +2102,7 @@ describe('SMS/Calls Incident Alerts', function(this: $TSFixMe) {
|
||||
* SMS/Call alerts enabled for the project (billing): true
|
||||
*/
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should correctly register closing balance for alert charges', async function(this: $TSFixMe) {
|
||||
it('should correctly register closing balance for alert charges', async function() {
|
||||
this.timeout(60 * 1000);
|
||||
|
||||
// update global setting to enable call and sms
|
||||
@@ -2610,7 +2610,7 @@ describe('SMS/Calls Incident Alerts', function(this: $TSFixMe) {
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Email Incident Alerts', function() {
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(30000);
|
||||
const createdUser = await createUser(request, userData.user);
|
||||
const project = createdUser.body.project;
|
||||
@@ -2710,7 +2710,7 @@ describe('Email Incident Alerts', function() {
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'after'.
|
||||
after(async function(this: $TSFixMe) {
|
||||
after(async function() {
|
||||
this.timeout(30000);
|
||||
await GlobalConfig.removeTestConfig();
|
||||
await OnCallScheduleStatusService.hardDeleteBy({ project: projectId });
|
||||
@@ -2740,7 +2740,7 @@ describe('Email Incident Alerts', function() {
|
||||
* Custom SMTP congigurations : not set.
|
||||
*/
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should not send Email alerts if no SMTP configurations are set.', async function(this: $TSFixMe) {
|
||||
it('should not send Email alerts if no SMTP configurations are set.', async function() {
|
||||
this.timeout(30000);
|
||||
const newIncident = await createIncident({
|
||||
request,
|
||||
@@ -2837,7 +2837,7 @@ describe('Email Incident Alerts', function() {
|
||||
* Custom SMTP congigurations : not set.
|
||||
*/
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should not send Email alerts if global SMTP configurations are set and email are disabled in global configurations.', async function(this: $TSFixMe) {
|
||||
it('should not send Email alerts if global SMTP configurations are set and email are disabled in global configurations.', async function() {
|
||||
this.timeout(30000);
|
||||
await GlobalConfigService.create({
|
||||
name: 'smtp',
|
||||
@@ -2943,7 +2943,7 @@ describe('Email Incident Alerts', function() {
|
||||
* Custom SMTP congigurations : not set.
|
||||
*/
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should send Email alerts if global SMTP configurations are set and email are enabled in global configurations.', async function(this: $TSFixMe) {
|
||||
it('should send Email alerts if global SMTP configurations are set and email are enabled in global configurations.', async function() {
|
||||
this.timeout(30000);
|
||||
await GlobalConfigService.create({
|
||||
name: 'smtp',
|
||||
@@ -3043,7 +3043,7 @@ describe('Email Incident Alerts', function() {
|
||||
* investigation note email notification : not set
|
||||
*/
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should not send statusPageNote(investigation note) Email notification when disabled', async function(this: $TSFixMe) {
|
||||
it('should not send statusPageNote(investigation note) Email notification when disabled', async function() {
|
||||
this.timeout(30 * 1000);
|
||||
// update global smtp settings
|
||||
await GlobalConfigService.create({
|
||||
@@ -3138,7 +3138,7 @@ describe('Email Incident Alerts', function() {
|
||||
* Custom SMTP congigurations : set.
|
||||
*/
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should send Email alerts if global SMTP configurations are set, email alerts disabled in global configurations, and custom SMTP settings are set.', async function(this: $TSFixMe) {
|
||||
it('should send Email alerts if global SMTP configurations are set, email alerts disabled in global configurations, and custom SMTP settings are set.', async function() {
|
||||
this.timeout(30000);
|
||||
await GlobalConfigService.create({
|
||||
name: 'smtp',
|
||||
@@ -3248,7 +3248,7 @@ describe('Email Incident Alerts', function() {
|
||||
* Custom SMTP congigurations : set.
|
||||
*/
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should send Email alerts if global SMTP configurations are not set, and custom SMTP settings are set.', async function(this: $TSFixMe) {
|
||||
it('should send Email alerts if global SMTP configurations are not set, and custom SMTP settings are set.', async function() {
|
||||
this.timeout(30000);
|
||||
await GlobalConfigService.hardDeleteBy({ name: 'smtp' });
|
||||
await EmailSmtpService.create({
|
||||
@@ -3341,10 +3341,10 @@ describe('Email Incident Alerts', function() {
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Webhook Incident Alerts', function(this: $TSFixMe) {
|
||||
describe('Webhook Incident Alerts', function() {
|
||||
this.timeout(30 * 1000);
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(30000);
|
||||
const createdUser = await createUser(request, userData.user);
|
||||
const project = createdUser.body.project;
|
||||
@@ -3448,7 +3448,7 @@ describe('Webhook Incident Alerts', function(this: $TSFixMe) {
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'after'.
|
||||
after(async function(this: $TSFixMe) {
|
||||
after(async function() {
|
||||
this.timeout(30000);
|
||||
await GlobalConfig.removeTestConfig();
|
||||
await OnCallScheduleStatusService.hardDeleteBy({ project: projectId });
|
||||
|
||||
@@ -24,7 +24,7 @@ const incidentSlaPayload = {
|
||||
isDefault: true,
|
||||
};
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Incident Communication SLA', function(this: $TSFixMe) {
|
||||
describe('Incident Communication SLA', function() {
|
||||
const timeout = 30000;
|
||||
let projectId: $TSFixMe, userId, token, authorization: $TSFixMe, slaId: $TSFixMe;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
const request = chai.request.agent(app);
|
||||
@@ -20,10 +20,10 @@ import AirtableService from '../backend/services/airtableService'
|
||||
let token: $TSFixMe, userId: $TSFixMe, projectId: $TSFixMe, defaultIncidentPriorityId: $TSFixMe, newIncidentPriorityId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Incident Priority API', function(this: $TSFixMe) {
|
||||
describe('Incident Priority API', function() {
|
||||
this.timeout(500000);
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(90000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
const request = chai.request.agent(app);
|
||||
@@ -42,10 +42,10 @@ const incidentSettings = {
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Incident Settings API', function(this: $TSFixMe) {
|
||||
describe('Incident Settings API', function() {
|
||||
this.timeout(500000);
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(90000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -33,7 +33,7 @@ const {
|
||||
} = require('./data/incomingHttpRequest');
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Incoming HTTP Request API', function(this: $TSFixMe) {
|
||||
describe('Incoming HTTP Request API', function() {
|
||||
const timeout = 30000;
|
||||
let projectId: $TSFixMe,
|
||||
componentId,
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
|
||||
import UserService from '../backend/services/userService'
|
||||
@@ -21,11 +21,11 @@ import { createUser } from './utils/userSignUp'
|
||||
let token: $TSFixMe, projectId: $TSFixMe, refreshToken: $TSFixMe, userId;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Jwt Token API', function(this: $TSFixMe) {
|
||||
describe('Jwt Token API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -3,7 +3,7 @@ process.env.PORT = 3020;
|
||||
const expect = require('chai').expect;
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
const request = chai.request.agent(app);
|
||||
@@ -26,11 +26,11 @@ const selectEmailStatus =
|
||||
'from to subject body createdAt template status content error deleted deletedAt deletedById replyTo smtpServer';
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Lead API', function(this: $TSFixMe) {
|
||||
describe('Lead API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(30000);
|
||||
await GlobalConfig.initTestConfig();
|
||||
});
|
||||
@@ -53,7 +53,7 @@ describe('Lead API', function(this: $TSFixMe) {
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should add lead when requested for type demo and check the sent message', function(this: $TSFixMe, done: $TSFixMe) {
|
||||
it('should add lead when requested for type demo and check the sent message', function( done: $TSFixMe) {
|
||||
this.timeout(60000);
|
||||
request
|
||||
.post('/lead')
|
||||
|
||||
@@ -6,7 +6,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
chai.use(require('chai-subset'));
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
@@ -75,11 +75,11 @@ const httpMonitorCriteria = {
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Monitor API', function(this: $TSFixMe) {
|
||||
describe('Monitor API', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(30000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
@@ -468,11 +468,11 @@ const HTTP_TEST_SERVER_URL = 'http://localhost:3010';
|
||||
const testServer = chai.request(HTTP_TEST_SERVER_URL);
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('API Monitor API', function(this: $TSFixMe) {
|
||||
describe('API Monitor API', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(30000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
@@ -685,11 +685,11 @@ describe('API Monitor API', function(this: $TSFixMe) {
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('IncomingHttpRequest Monitor', function(this: $TSFixMe) {
|
||||
describe('IncomingHttpRequest Monitor', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(30000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
@@ -879,11 +879,11 @@ describe('IncomingHttpRequest Monitor', function(this: $TSFixMe) {
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Monitor API with resource Category', function(this: $TSFixMe) {
|
||||
describe('Monitor API with resource Category', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
@@ -959,7 +959,7 @@ describe('Monitor API with resource Category', function(this: $TSFixMe) {
|
||||
let subProjectId: $TSFixMe, newUserToken: $TSFixMe, subProjectMonitorId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Monitor API with Sub-Projects', function(this: $TSFixMe) {
|
||||
describe('Monitor API with Sub-Projects', function() {
|
||||
this.timeout(30000);
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(done: $TSFixMe) {
|
||||
@@ -1203,7 +1203,7 @@ describe('Monitor API with Sub-Projects', function(this: $TSFixMe) {
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Monitor API - Tests Project Seats With SubProjects', function(this: $TSFixMe) {
|
||||
describe('Monitor API - Tests Project Seats With SubProjects', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
const monitorDataArray = [
|
||||
@@ -1260,7 +1260,7 @@ describe('Monitor API - Tests Project Seats With SubProjects', function(this: $T
|
||||
];
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(30000);
|
||||
await GlobalConfig.initTestConfig();
|
||||
const authorization = `Basic ${token}`;
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -19,11 +19,11 @@ import AirtableService from '../backend/services/airtableService'
|
||||
let token: $TSFixMe, projectId: $TSFixMe, userId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Monitor Criteria API', function(this: $TSFixMe) {
|
||||
describe('Monitor Criteria API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -20,7 +20,7 @@ import ComponentService from '../backend/services/componentService'
|
||||
import MonitorCustomFieldService from '../backend/services/monitorCustomField'
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Monitor Custom Field API', function(this: $TSFixMe) {
|
||||
describe('Monitor Custom Field API', function() {
|
||||
const timeout = 30000;
|
||||
let projectId: $TSFixMe, userId, token, authorization: $TSFixMe, monitorCustomFieldId: $TSFixMe;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ const monitorSlaPayload = {
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Monitor SLA', function(this: $TSFixMe) {
|
||||
describe('Monitor SLA', function() {
|
||||
const timeout = 30000;
|
||||
let projectId: $TSFixMe, userId, token, authorization: $TSFixMe, slaId: $TSFixMe;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import userData from './data/user'
|
||||
import projectData from './data/project'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
|
||||
import UserService from '../backend/services/userService'
|
||||
@@ -23,11 +23,11 @@ import { createUser } from './utils/userSignUp'
|
||||
let projectId: $TSFixMe, token: $TSFixMe, userId;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Notification API', function(this: $TSFixMe) {
|
||||
describe('Notification API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -46,11 +46,11 @@ const probeServerRequestHeader = ({
|
||||
let probeServerName1: $TSFixMe, probeServerName2: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Probe API', function(this: $TSFixMe) {
|
||||
describe('Probe API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(40000);
|
||||
await GlobalConfig.initTestConfig();
|
||||
// remove every monitor in DB
|
||||
@@ -254,7 +254,7 @@ describe('Probe API', function(this: $TSFixMe) {
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should return the list of monitors of type "server-monitor" only time for one probe server during an interval of 1 min ', async function(this: $TSFixMe) {
|
||||
it('should return the list of monitors of type "server-monitor" only time for one probe server during an interval of 1 min ', async function() {
|
||||
this.timeout(100000);
|
||||
const monitor = await MonitorService.create({
|
||||
projectId,
|
||||
@@ -337,7 +337,7 @@ describe('Probe API', function(this: $TSFixMe) {
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should return the list of monitors of type "url" only 1 time for every probe server during an interval of 1 min', async function(this: $TSFixMe) {
|
||||
it('should return the list of monitors of type "url" only 1 time for every probe server during an interval of 1 min', async function() {
|
||||
this.timeout(100000);
|
||||
const monitor = await MonitorService.create({
|
||||
projectId,
|
||||
|
||||
@@ -6,7 +6,7 @@ const requests: $TSFixMe = [];
|
||||
let app, request: $TSFixMe, sandbox: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('API limit rate', function(this: $TSFixMe) {
|
||||
describe('API limit rate', function() {
|
||||
this.timeout(10000);
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(done: $TSFixMe) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import moment from 'moment'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
@@ -37,11 +37,11 @@ const startDate = moment()
|
||||
const filter = 'month';
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Reports API', function(this: $TSFixMe) {
|
||||
describe('Reports API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -22,11 +22,11 @@ import VerificationTokenModel from '../backend/models/verificationToken'
|
||||
let token: $TSFixMe, projectId: $TSFixMe, scheduleId: $TSFixMe, userId;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Schedule API', function(this: $TSFixMe) {
|
||||
describe('Schedule API', function() {
|
||||
this.timeout(30000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
@@ -169,10 +169,10 @@ describe('Schedule API', function(this: $TSFixMe) {
|
||||
let subProjectId: $TSFixMe, newUserToken: $TSFixMe, subProjectScheduleId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Schedule API with Sub-Projects', function(this: $TSFixMe) {
|
||||
describe('Schedule API with Sub-Projects', function() {
|
||||
this.timeout(30000);
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(30000);
|
||||
const authorization = `Basic ${token}`;
|
||||
// create a subproject for parent project
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -49,11 +49,11 @@ const ongoingScheduledEvent = {
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Scheduled event API', function(this: $TSFixMe) {
|
||||
describe('Scheduled event API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
@@ -379,11 +379,11 @@ describe('Scheduled event API', function(this: $TSFixMe) {
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('User from other project have access to read / write and delete API.', function(this: $TSFixMe) {
|
||||
describe('User from other project have access to read / write and delete API.', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -66,11 +66,11 @@ const updatedInvestigationNote = {
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Scheduled Event Note', function(this: $TSFixMe) {
|
||||
describe('Scheduled Event Note', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -17,10 +17,10 @@ let token: $TSFixMe,
|
||||
projectId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Slack API', function(this: $TSFixMe) {
|
||||
describe('Slack API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
this.beforeAll(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
this.beforeAll(function( done: $TSFixMe) {
|
||||
this.timeout(30000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
request
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -22,11 +22,11 @@ import VerificationTokenModel from '../backend/models/verificationToken'
|
||||
let token: $TSFixMe, projectId: $TSFixMe, userId, smsTemplateId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('SMS Template API', function(this: $TSFixMe) {
|
||||
describe('SMS Template API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(40000);
|
||||
await GlobalConfig.initTestConfig();
|
||||
const res = await createUser(request, userData.user);
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -30,11 +30,11 @@ const ssoObject = {
|
||||
let token: $TSFixMe, userId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('SSO API', function(this: $TSFixMe) {
|
||||
describe('SSO API', function() {
|
||||
this.timeout(300000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.adminUser, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
const request = chai.request.agent(app);
|
||||
@@ -80,10 +80,10 @@ const projectCreationPayloads = [
|
||||
];
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('SSO DEFAULT ROLES API', function(this: $TSFixMe) {
|
||||
describe('SSO DEFAULT ROLES API', function() {
|
||||
this.timeout(300000);
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(40000);
|
||||
await GlobalConfig.initTestConfig();
|
||||
const response = await createUser(request, userData.adminUser);
|
||||
|
||||
@@ -61,11 +61,11 @@ const scheduledEvent = {
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Status API', function(this: $TSFixMe) {
|
||||
describe('Status API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(async function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
@@ -926,10 +926,10 @@ describe('Status API', function(this: $TSFixMe) {
|
||||
let subProjectId: $TSFixMe, newUserToken: $TSFixMe, anotherUserToken: $TSFixMe, subProjectStatusPageId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('StatusPage API with Sub-Projects', function(this: $TSFixMe) {
|
||||
describe('StatusPage API with Sub-Projects', function() {
|
||||
this.timeout(30000);
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(30000);
|
||||
const authorization = `Basic ${token}`;
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
|
||||
@@ -22,11 +22,11 @@ import VerificationTokenModel from '../backend/models/verificationToken'
|
||||
let cardId: $TSFixMe, authorization: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Stripe payment API', function(this: $TSFixMe) {
|
||||
describe('Stripe payment API', function() {
|
||||
this.timeout(50000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
const request = chai.request.agent(app);
|
||||
@@ -57,11 +57,11 @@ const csvData = {
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Subscriber API', function(this: $TSFixMe) {
|
||||
describe('Subscriber API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
const request = chai.request.agent(app);
|
||||
@@ -33,11 +33,11 @@ const monitor = {
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Subcriber Alert API', function(this: $TSFixMe) {
|
||||
describe('Subcriber Alert API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -20,11 +20,11 @@ import VerificationTokenModel from '../backend/models/verificationToken'
|
||||
let projectId: $TSFixMe, userId: $TSFixMe, token: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Tutorial API', function(this: $TSFixMe) {
|
||||
describe('Tutorial API', function() {
|
||||
this.timeout(80000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(120000);
|
||||
await GlobalConfig.initTestConfig();
|
||||
const res = await createUser(request, userData.user);
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -32,11 +32,11 @@ const monitor = {
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Twilio API', function(this: $TSFixMe) {
|
||||
describe('Twilio API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async function(this: $TSFixMe) {
|
||||
before(async function() {
|
||||
this.timeout(40000);
|
||||
await GlobalConfig.initTestConfig();
|
||||
let res = await createUser(request, userData.user);
|
||||
|
||||
@@ -28,11 +28,11 @@ let projectId: $TSFixMe, userId: $TSFixMe, token: $TSFixMe;
|
||||
const deleteAccountConfirmation = { deleteMyAccount: 'DELETE MY ACCOUNT' };
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('User API', function(this: $TSFixMe) {
|
||||
describe('User API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, data.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
@@ -630,7 +630,7 @@ describe('User API', function(this: $TSFixMe) {
|
||||
|
||||
let ssoId: $TSFixMe;
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('SSO authentication', function(this: $TSFixMe) {
|
||||
describe('SSO authentication', function() {
|
||||
this.timeout(20000);
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(async () => {
|
||||
|
||||
@@ -3,13 +3,13 @@ process.env.PORT = 3020;
|
||||
const expect = require('chai').expect;
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
const request = chai.request.agent(app);
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Version API', function(this: $TSFixMe) {
|
||||
describe('Version API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -46,11 +46,11 @@ const slackPayload = {
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Webhook API', function(this: $TSFixMe) {
|
||||
describe('Webhook API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, async function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const expect = require('chai').expect;
|
||||
import userData from './data/user'
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
import GlobalConfig from './utils/globalConfig'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -30,11 +30,11 @@ const monitor = {
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Zapier API', function(this: $TSFixMe) {
|
||||
describe('Zapier API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function( done: $TSFixMe) {
|
||||
this.timeout(40000);
|
||||
GlobalConfig.initTestConfig().then(function() {
|
||||
createUser(request, userData.user, function(err: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
@@ -3,13 +3,13 @@ process.env.PORT = 3424;
|
||||
const expect = require('chai').expect;
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
const request = chai.request.agent(app);
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Version API', function(this: $TSFixMe) {
|
||||
describe('Version API', function() {
|
||||
this.timeout(20000);
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
it('should get the current helm-chart version', function(done: $TSFixMe) {
|
||||
|
||||
@@ -27,11 +27,11 @@ const timeout = 5000,
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Server Monitor', function(this: $TSFixMe) {
|
||||
describe('Server Monitor', function() {
|
||||
this.timeout(timeout + 1000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function(done: $TSFixMe) {
|
||||
this.timeout(30000);
|
||||
|
||||
request
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
/*eslint-disable no-unused-vars*/
|
||||
import Http from 'http'
|
||||
import Https from 'https'
|
||||
import Http from 'http';
|
||||
import Https from 'https';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'uuid... Remove this comment to see the full error message
|
||||
import { v4 as uuidv4} from 'uuid'
|
||||
import { getRoutes } from 'get-routes'
|
||||
import UrlPattern from 'url-pattern'
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { getRoutes } from 'get-routes';
|
||||
import UrlPattern from 'url-pattern';
|
||||
|
||||
class IncomingListener {
|
||||
#start;
|
||||
#end;
|
||||
#store;
|
||||
#app;
|
||||
private start;
|
||||
private end;
|
||||
private store;
|
||||
private app;
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'start' implicitly has an 'any' type.
|
||||
constructor(start, end, store, app) {
|
||||
this.#start = start;
|
||||
this.#end = end;
|
||||
this.#store = store;
|
||||
this.#app = app;
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.store = store;
|
||||
this.app = app;
|
||||
this._setUpIncomingListener();
|
||||
}
|
||||
_setUpIncomingListener() {
|
||||
@@ -36,8 +36,8 @@ class IncomingListener {
|
||||
let finalPattern = path;
|
||||
|
||||
// this will only work with express application
|
||||
if (_this.#app && _this.#app._router) {
|
||||
const routes = getRoutes(_this.#app);
|
||||
if (_this.app && _this.app._router) {
|
||||
const routes = getRoutes(_this.app);
|
||||
for (const [key, value] of Object.entries(routes)) {
|
||||
if (key === String(method).toLowerCase()) {
|
||||
for (const val of value) {
|
||||
@@ -55,7 +55,7 @@ class IncomingListener {
|
||||
|
||||
req.apm = {};
|
||||
req.apm.uuid = uuidv4();
|
||||
const result = _this.#start(req.apm.uuid, {
|
||||
const result = _this.start(req.apm.uuid, {
|
||||
path: finalPattern,
|
||||
type: 'incoming',
|
||||
method,
|
||||
@@ -68,19 +68,19 @@ class IncomingListener {
|
||||
res.statusCode < 600
|
||||
) {
|
||||
// error must have occurred
|
||||
const originalValue = _this.#store.getValue(
|
||||
const originalValue = _this.store.getValue(
|
||||
req.apm.uuid
|
||||
);
|
||||
if (originalValue && originalValue !== undefined) {
|
||||
originalValue.errorCount = 1;
|
||||
_this.#store.setValue(
|
||||
_this.store.setValue(
|
||||
req.apm.uuid,
|
||||
originalValue
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
_this.#end(req.apm.uuid, result, 'request');
|
||||
_this.end(req.apm.uuid, result, 'request');
|
||||
});
|
||||
}
|
||||
return emit.apply(this, arguments);
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
/*eslint-disable no-unused-vars*/
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'uuid... Remove this comment to see the full error message
|
||||
import { v4 as uuidv4} from 'uuid'
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
class MongooseListener {
|
||||
#start;
|
||||
#end;
|
||||
private start;
|
||||
private end;
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'start' implicitly has an 'any' type.
|
||||
constructor(start, end) {
|
||||
this.#start = start;
|
||||
this.#end = end;
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
}
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'orig' implicitly has an 'any' type.
|
||||
wrapAsync(orig, name) {
|
||||
@@ -20,17 +20,17 @@ class MongooseListener {
|
||||
// @ts-expect-error ts-migrate(2683) FIXME: 'this' implicitly has type 'any' because it does n... Remove this comment to see the full error message
|
||||
const operation = this.op;
|
||||
name = name || `mongoose.${operation}`; // mongose Query.exec specific
|
||||
const result = _this.#start(uuid, {
|
||||
const result = _this.start(uuid, {
|
||||
path: operation,
|
||||
type: 'mongoose',
|
||||
});
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2683) FIXME: 'this' implicitly has type 'any' because it does n... Remove this comment to see the full error message
|
||||
const res = await orig.apply(this, arguments);
|
||||
_this.#end(uuid, result, name);
|
||||
_this.end(uuid, result, name);
|
||||
return res;
|
||||
} catch (err) {
|
||||
_this.#end(uuid, result, name);
|
||||
_this.end(uuid, result, name);
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
/*eslint-disable no-unused-vars*/
|
||||
import Http from 'http'
|
||||
import Https from 'https'
|
||||
import Http from 'http';
|
||||
import Https from 'https';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'uuid... Remove this comment to see the full error message
|
||||
import { v4 as uuidv4} from 'uuid'
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
class OutgoingListener {
|
||||
#start;
|
||||
#end;
|
||||
#store;
|
||||
private start;
|
||||
private end;
|
||||
private store;
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'start' implicitly has an 'any' type.
|
||||
constructor(start, end, store) {
|
||||
this.#start = start;
|
||||
this.#end = end;
|
||||
this.#store = store;
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.store = store;
|
||||
this._setUpOutgoingListener();
|
||||
}
|
||||
_setUpOutgoingListener() {
|
||||
@@ -39,7 +39,7 @@ class OutgoingListener {
|
||||
const emit = req.emit;
|
||||
req.apm = {};
|
||||
req.apm.uuid = uuidv4();
|
||||
const result = _this.#start(req.apm.uuid, {
|
||||
const result = _this.start(req.apm.uuid, {
|
||||
path: `${protocol}//${host}${path}`, // store full path for outgoing requests
|
||||
type: 'outgoing',
|
||||
method,
|
||||
@@ -49,22 +49,22 @@ class OutgoingListener {
|
||||
switch (eventName) {
|
||||
case 'response': {
|
||||
response.on('end', () => {
|
||||
_this.#end(req.apm.uuid, result, 'response');
|
||||
_this.end(req.apm.uuid, result, 'response');
|
||||
});
|
||||
break;
|
||||
}
|
||||
case 'error': {
|
||||
const originalValue = _this.#store.getValue(
|
||||
const originalValue = _this.store.getValue(
|
||||
req.apm.uuid
|
||||
);
|
||||
if (originalValue && originalValue !== undefined) {
|
||||
originalValue.errorCount = 1;
|
||||
_this.#store.setValue(
|
||||
_this.store.setValue(
|
||||
req.apm.uuid,
|
||||
originalValue
|
||||
);
|
||||
}
|
||||
_this.#end(req.apm.uuid, result, 'response');
|
||||
_this.end(req.apm.uuid, result, 'response');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/*eslint-disable no-unused-vars*/
|
||||
import Module from 'module';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'semv... Remove this comment to see the full error message
|
||||
import semver from 'semver'
|
||||
import semver from 'semver';
|
||||
import MongooseListener from './listeners/mongoose';
|
||||
import IncomingListener from './listeners/incomingListener';
|
||||
import OutgoingListener from './listeners/outgoingListener';
|
||||
import PerfTimer from './utils/perfTimer';
|
||||
import HrTimer from './utils/hrTimer';
|
||||
class PerformanceTracker {
|
||||
#apiUrl;
|
||||
#appId;
|
||||
#appKey;
|
||||
#nodeVer;
|
||||
#nodeUse;
|
||||
#start;
|
||||
#end;
|
||||
#store;
|
||||
private apiUrl;
|
||||
private appId;
|
||||
private appKey;
|
||||
private nodeVer;
|
||||
private nodeUse;
|
||||
private start;
|
||||
private end;
|
||||
private store;
|
||||
constructor({
|
||||
apiUrl,
|
||||
appId,
|
||||
@@ -24,29 +24,29 @@ class PerformanceTracker {
|
||||
trackOutgoingRequest = true,
|
||||
|
||||
// express app instance
|
||||
app
|
||||
app,
|
||||
}: $TSFixMe) {
|
||||
this.#apiUrl = apiUrl;
|
||||
this.#appId = appId;
|
||||
this.#appKey = appKey;
|
||||
this.#nodeVer = process.versions.node;
|
||||
if (semver.satisfies(this.#nodeVer, '>10.0.0')) {
|
||||
this.#nodeUse = true;
|
||||
this.apiUrl = apiUrl;
|
||||
this.appId = appId;
|
||||
this.appKey = appKey;
|
||||
this.nodeVer = process.versions.node;
|
||||
if (semver.satisfies(this.nodeVer, '>10.0.0')) {
|
||||
this.nodeUse = true;
|
||||
} else {
|
||||
this.#nodeUse = false;
|
||||
this.nodeUse = false;
|
||||
}
|
||||
if (this.#nodeUse) {
|
||||
const perf = new PerfTimer(this.#apiUrl, this.#appId, this.#appKey);
|
||||
if (this.nodeUse) {
|
||||
const perf = new PerfTimer(this.apiUrl, this.appId, this.appKey);
|
||||
const { start, end, store } = perf;
|
||||
this.#start = start;
|
||||
this.#end = end;
|
||||
this.#store = store(); // returns the store instance
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.store = store(); // returns the store instance
|
||||
} else {
|
||||
const hrt = new HrTimer(this.#apiUrl, this.#appId, this.#appKey);
|
||||
const hrt = new HrTimer(this.apiUrl, this.appId, this.appKey);
|
||||
const { start, end, store } = hrt;
|
||||
this.#start = start;
|
||||
this.#end = end;
|
||||
this.#store = store(); // returns the store instance
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.store = store(); // returns the store instance
|
||||
}
|
||||
|
||||
if (trackIncomingRequest) {
|
||||
@@ -67,10 +67,10 @@ class PerformanceTracker {
|
||||
process.on('uncaughtException', this._sendDataOnExit.bind(this));
|
||||
}
|
||||
async _sendDataOnExit() {
|
||||
await this.#store.processDataOnExit();
|
||||
await this.store.processDataOnExit();
|
||||
}
|
||||
_setUpOutgoingListener() {
|
||||
return new OutgoingListener(this.#start, this.#end, this.#store);
|
||||
return new OutgoingListener(this.start, this.end, this.store);
|
||||
}
|
||||
setUpDataBaseListener() {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property '_load' does not exist on type 'typeof Mo... Remove this comment to see the full error message
|
||||
@@ -80,14 +80,14 @@ class PerformanceTracker {
|
||||
Module._load = function(request: $TSFixMe, parent: $TSFixMe) {
|
||||
const res = load.apply(this, arguments);
|
||||
if (request === 'mongoose') {
|
||||
const mongo = new MongooseListener(_this.#start, _this.#end);
|
||||
const mongo = new MongooseListener(_this.start, _this.end);
|
||||
return mongo._setUpMongooseListener(res);
|
||||
}
|
||||
return res;
|
||||
};
|
||||
}
|
||||
_setUpIncomingListener(app: $TSFixMe) {
|
||||
return new IncomingListener(this.#start, this.#end, this.#store, app);
|
||||
return new IncomingListener(this.start, this.end, this.store, app);
|
||||
}
|
||||
}
|
||||
export default PerformanceTracker;
|
||||
|
||||
@@ -3,25 +3,25 @@
|
||||
/*eslint-disable no-unused-vars*/
|
||||
import axios from 'axios';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'node... Remove this comment to see the full error message
|
||||
import cron from 'node-cron'
|
||||
import cron from 'node-cron';
|
||||
class DataStore {
|
||||
#store;
|
||||
#incoming;
|
||||
#outgoing;
|
||||
#mongoose;
|
||||
#apiUrl;
|
||||
#appId;
|
||||
#appKey;
|
||||
#sendingData;
|
||||
private store;
|
||||
private incoming;
|
||||
private outgoing;
|
||||
private mongoose;
|
||||
private apiUrl;
|
||||
private appId;
|
||||
private appKey;
|
||||
private sendingData;
|
||||
constructor(url: $TSFixMe, appId: $TSFixMe, appKey: $TSFixMe) {
|
||||
this.#apiUrl = url;
|
||||
this.#appId = appId;
|
||||
this.#appKey = appKey;
|
||||
this.#store = new Map();
|
||||
this.#incoming = new Map();
|
||||
this.#outgoing = new Map();
|
||||
this.#mongoose = new Map();
|
||||
this.#sendingData = false;
|
||||
this.apiUrl = url;
|
||||
this.appId = appId;
|
||||
this.appKey = appKey;
|
||||
this.store = new Map();
|
||||
this.incoming = new Map();
|
||||
this.outgoing = new Map();
|
||||
this.mongoose = new Map();
|
||||
this.sendingData = false;
|
||||
this.runCron();
|
||||
}
|
||||
runCron() {
|
||||
@@ -30,7 +30,13 @@ class DataStore {
|
||||
_this.sendData();
|
||||
});
|
||||
}
|
||||
mapValue(path: $TSFixMe, store: $TSFixMe, time: $TSFixMe, method: $TSFixMe, errorCount: $TSFixMe) {
|
||||
mapValue(
|
||||
path: $TSFixMe,
|
||||
store: $TSFixMe,
|
||||
time: $TSFixMe,
|
||||
method: $TSFixMe,
|
||||
errorCount: $TSFixMe
|
||||
) {
|
||||
if (store.has(path)) {
|
||||
const s = store.get(path);
|
||||
const avg = s.avgTime,
|
||||
@@ -56,29 +62,29 @@ class DataStore {
|
||||
}
|
||||
}
|
||||
destroy(id: $TSFixMe) {
|
||||
if (this.#store.has(id)) {
|
||||
this.#store.delete(id);
|
||||
if (this.store.has(id)) {
|
||||
this.store.delete(id);
|
||||
}
|
||||
}
|
||||
|
||||
getValue(id: $TSFixMe) {
|
||||
return this.#store.get(id);
|
||||
return this.store.get(id);
|
||||
}
|
||||
|
||||
getAllData() {
|
||||
return {
|
||||
incoming: this.#incoming,
|
||||
outgoing: this.#outgoing,
|
||||
mongoose: this.#mongoose,
|
||||
incoming: this.incoming,
|
||||
outgoing: this.outgoing,
|
||||
mongoose: this.mongoose,
|
||||
};
|
||||
}
|
||||
clear() {
|
||||
return this.#store.clear();
|
||||
return this.store.clear();
|
||||
}
|
||||
clearData() {
|
||||
this.#incoming.clear();
|
||||
this.#outgoing.clear();
|
||||
this.#mongoose.clear();
|
||||
this.incoming.clear();
|
||||
this.outgoing.clear();
|
||||
this.mongoose.clear();
|
||||
return {};
|
||||
}
|
||||
setData(value: $TSFixMe) {
|
||||
@@ -89,44 +95,44 @@ class DataStore {
|
||||
const errorCount = value.errorCount || 0;
|
||||
let val = {};
|
||||
if (type === 'incoming') {
|
||||
val = this.mapValue(path, this.#incoming, time, method, errorCount);
|
||||
return this.#incoming.set(path, val);
|
||||
val = this.mapValue(path, this.incoming, time, method, errorCount);
|
||||
return this.incoming.set(path, val);
|
||||
} else if (type === 'outgoing') {
|
||||
val = this.mapValue(path, this.#outgoing, time, method, errorCount);
|
||||
return this.#outgoing.set(path, val);
|
||||
val = this.mapValue(path, this.outgoing, time, method, errorCount);
|
||||
return this.outgoing.set(path, val);
|
||||
} else if (type === 'mongoose') {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 5 arguments, but got 3.
|
||||
val = this.mapValue(path, this.#mongoose, time);
|
||||
return this.#mongoose.set(path, val);
|
||||
val = this.mapValue(path, this.mongoose, time);
|
||||
return this.mongoose.set(path, val);
|
||||
}
|
||||
}
|
||||
setValue(id: $TSFixMe, value: $TSFixMe) {
|
||||
return this.#store.set(id, value);
|
||||
return this.store.set(id, value);
|
||||
}
|
||||
async sendData() {
|
||||
const data = {
|
||||
// @ts-expect-error ts-migrate(2550) FIXME: Property 'fromEntries' does not exist on type 'Obj... Remove this comment to see the full error message
|
||||
incoming: Object.fromEntries(this.#incoming),
|
||||
incoming: Object.fromEntries(this.incoming),
|
||||
// @ts-expect-error ts-migrate(2550) FIXME: Property 'fromEntries' does not exist on type 'Obj... Remove this comment to see the full error message
|
||||
outgoing: Object.fromEntries(this.#outgoing),
|
||||
outgoing: Object.fromEntries(this.outgoing),
|
||||
// @ts-expect-error ts-migrate(2550) FIXME: Property 'fromEntries' does not exist on type 'Obj... Remove this comment to see the full error message
|
||||
mongoose: Object.fromEntries(this.#mongoose),
|
||||
mongoose: Object.fromEntries(this.mongoose),
|
||||
sentAt: Date.now(),
|
||||
};
|
||||
await this._makeApiRequest(data);
|
||||
this.clearData();
|
||||
}
|
||||
async processDataOnExit() {
|
||||
if (!this.#sendingData) {
|
||||
this.#sendingData = true;
|
||||
if (!this.sendingData) {
|
||||
this.sendingData = true;
|
||||
|
||||
const data = {
|
||||
// @ts-expect-error ts-migrate(2550) FIXME: Property 'fromEntries' does not exist on type 'Obj... Remove this comment to see the full error message
|
||||
incoming: Object.fromEntries(this.#incoming),
|
||||
incoming: Object.fromEntries(this.incoming),
|
||||
// @ts-expect-error ts-migrate(2550) FIXME: Property 'fromEntries' does not exist on type 'Obj... Remove this comment to see the full error message
|
||||
outgoing: Object.fromEntries(this.#outgoing),
|
||||
outgoing: Object.fromEntries(this.outgoing),
|
||||
// @ts-expect-error ts-migrate(2550) FIXME: Property 'fromEntries' does not exist on type 'Obj... Remove this comment to see the full error message
|
||||
mongoose: Object.fromEntries(this.#mongoose),
|
||||
mongoose: Object.fromEntries(this.mongoose),
|
||||
sentAt: Date.now(),
|
||||
};
|
||||
await this._makeApiRequest(data);
|
||||
@@ -138,9 +144,7 @@ class DataStore {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios
|
||||
.post(
|
||||
`${this.#apiUrl}/performanceMetric/${this.#appId}/key/${
|
||||
this.#appKey
|
||||
}`,
|
||||
`${this.apiUrl}/performanceMetric/${this.appId}/key/${this.appKey}`,
|
||||
data
|
||||
)
|
||||
.then(res => {
|
||||
|
||||
@@ -3,23 +3,19 @@
|
||||
/*eslint-disable no-unused-vars*/
|
||||
import DataStore from './dataStore';
|
||||
class HrTimer {
|
||||
#dataStore;
|
||||
#apiUrl;
|
||||
#appId;
|
||||
#appKey;
|
||||
private dataStore;
|
||||
private apiUrl;
|
||||
private appId;
|
||||
private appKey;
|
||||
constructor(apiUrl: $TSFixMe, appId: $TSFixMe, appKey: $TSFixMe) {
|
||||
this.#apiUrl = apiUrl;
|
||||
this.#appId = appId;
|
||||
this.#appKey = appKey;
|
||||
this.#dataStore = new DataStore(
|
||||
this.#apiUrl,
|
||||
this.#appId,
|
||||
this.#appKey
|
||||
);
|
||||
this.apiUrl = apiUrl;
|
||||
this.appId = appId;
|
||||
this.appKey = appKey;
|
||||
this.dataStore = new DataStore(this.apiUrl, this.appId, this.appKey);
|
||||
}
|
||||
|
||||
start = (id: $TSFixMe, log: $TSFixMe) => {
|
||||
this.#dataStore.setValue(id, log);
|
||||
this.dataStore.setValue(id, log);
|
||||
return process.hrtime();
|
||||
};
|
||||
|
||||
@@ -27,16 +23,16 @@ class HrTimer {
|
||||
let elapsedHrTime = process.hrtime(startHrTime);
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'number' is not assignable to type '[number, ... Remove this comment to see the full error message
|
||||
elapsedHrTime = elapsedHrTime[0] * 1000 + elapsedHrTime[1] / 1e6;
|
||||
const originalValue = this.#dataStore.getValue(id);
|
||||
const originalValue = this.dataStore.getValue(id);
|
||||
if (originalValue && originalValue !== undefined) {
|
||||
originalValue.duration = elapsedHrTime;
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 2.
|
||||
this.#dataStore.setData(id, originalValue);
|
||||
this.#dataStore.destroy(id);
|
||||
this.dataStore.setData(id, originalValue);
|
||||
this.dataStore.destroy(id);
|
||||
}
|
||||
return;
|
||||
};
|
||||
|
||||
store = () => this.#dataStore;
|
||||
store = () => this.dataStore;
|
||||
}
|
||||
export default HrTimer;
|
||||
|
||||
@@ -5,27 +5,23 @@ import { performance, PerformanceObserver } from 'perf_hooks';
|
||||
import DataStore from './dataStore';
|
||||
class PerfTimer {
|
||||
obs: $TSFixMe;
|
||||
#dataStore;
|
||||
#apiUrl;
|
||||
#appId;
|
||||
#appKey;
|
||||
private dataStore;
|
||||
private apiUrl;
|
||||
private appId;
|
||||
private appKey;
|
||||
constructor(apiUrl: $TSFixMe, appId: $TSFixMe, appKey: $TSFixMe) {
|
||||
this.#apiUrl = apiUrl;
|
||||
this.#appId = appId;
|
||||
this.#appKey = appKey;
|
||||
this.#dataStore = new DataStore(
|
||||
this.#apiUrl,
|
||||
this.#appId,
|
||||
this.#appKey
|
||||
);
|
||||
this.apiUrl = apiUrl;
|
||||
this.appId = appId;
|
||||
this.appKey = appKey;
|
||||
this.dataStore = new DataStore(this.apiUrl, this.appId, this.appKey);
|
||||
this.obs = new PerformanceObserver((list, observer) => {
|
||||
const entry = list.getEntries()[0];
|
||||
const id = entry.name.slice(entry.name.indexOf('-') + 1);
|
||||
const originalValue = this.#dataStore.getValue(id);
|
||||
const originalValue = this.dataStore.getValue(id);
|
||||
if (originalValue && originalValue !== undefined) {
|
||||
originalValue.duration = entry.duration;
|
||||
this.#dataStore.setData(originalValue);
|
||||
this.#dataStore.destroy(id);
|
||||
this.dataStore.setData(originalValue);
|
||||
this.dataStore.destroy(id);
|
||||
}
|
||||
performance.clearMarks();
|
||||
// observer.disconnect();
|
||||
@@ -34,7 +30,7 @@ class PerfTimer {
|
||||
}
|
||||
|
||||
start = (id: $TSFixMe, log: $TSFixMe) => {
|
||||
this.#dataStore.setValue(id, log);
|
||||
this.dataStore.setValue(id, log);
|
||||
return performance.mark(`start-${id}`);
|
||||
};
|
||||
|
||||
@@ -43,6 +39,6 @@ class PerfTimer {
|
||||
return performance.measure(`${type}-${id}`, `start-${id}`, `end-${id}`);
|
||||
};
|
||||
|
||||
store = () => this.#dataStore;
|
||||
store = () => this.dataStore;
|
||||
}
|
||||
export default PerfTimer;
|
||||
|
||||
@@ -11,7 +11,7 @@ const timeout = 5000;
|
||||
import OneUptimeLogger from '../src/logger';
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('OneUptimeLogger', function(this: $TSFixMe) {
|
||||
describe('OneUptimeLogger', function() {
|
||||
const sleep = (milliseconds: $TSFixMe) => {
|
||||
return new Promise(resolve => setTimeout(resolve, milliseconds));
|
||||
};
|
||||
@@ -24,7 +24,7 @@ describe('OneUptimeLogger', function(this: $TSFixMe) {
|
||||
const component = { name: 'Our Component' };
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function(done: $TSFixMe) {
|
||||
this.timeout(60000);
|
||||
sleep(5000).then(() => {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'email' does not exist on type '{ name: s... Remove this comment to see the full error message
|
||||
|
||||
@@ -20,7 +20,7 @@ const customTimeline = {
|
||||
let errorTracker: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('Tracker Timeline', function(this: $TSFixMe) {
|
||||
describe('Tracker Timeline', function() {
|
||||
const sleep = (milliseconds: $TSFixMe) => {
|
||||
return new Promise(resolve => setTimeout(resolve, milliseconds));
|
||||
};
|
||||
@@ -30,7 +30,7 @@ describe('Tracker Timeline', function(this: $TSFixMe) {
|
||||
const component = { name: 'Our Component' };
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
before(function(this: $TSFixMe, done: $TSFixMe) {
|
||||
before(function(done: $TSFixMe) {
|
||||
this.timeout(60000);
|
||||
sleep(5000).then(() => {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'email' does not exist on type '{ name: s... Remove this comment to see the full error message
|
||||
|
||||
@@ -8,7 +8,7 @@ const {
|
||||
} = require('./data/license');
|
||||
import chai from 'chai'
|
||||
import chai-http from 'chai-http';
|
||||
chai.use(chai-http);
|
||||
chai.use(chaihttp);
|
||||
import app from '../server'
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'ChaiSta... Remove this comment to see the full error message
|
||||
@@ -20,7 +20,7 @@ const email = 'license@hackerbay.io';
|
||||
let validLicenseId: $TSFixMe, expiredLicenseId: $TSFixMe;
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
describe('License API', function(this: $TSFixMe) {
|
||||
describe('License API', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
|
||||
@@ -231,7 +231,7 @@ class OneUptimeTracker
|
||||
// get current timeline
|
||||
$timeline = $this->getTimeline();
|
||||
// TODO get device location and details
|
||||
// const deviceDetails = this.#utilObj._getUserDeviceDetails();
|
||||
// const deviceDetails = this.utilObj._getUserDeviceDetails();
|
||||
$tags = $this->getTags();
|
||||
$fingerprint = $this->getFingerprint($errorStackTrace->message); // default fingerprint will be the message from the error stacktrace
|
||||
// get event ID
|
||||
|
||||
Reference in New Issue
Block a user