mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 07:10:53 +00:00
add jest config to probe
This commit is contained in:
parent
4320be66f1
commit
e30ca1ddfd
@ -6,6 +6,7 @@ import LocalCache from 'CommonServer/Infrastructure/LocalCache';
|
||||
import URL from 'Common/Types/API/URL';
|
||||
import logger from 'CommonServer/Utils/Logger';
|
||||
import ProbeAPIRequest from '../Utils/ProbeAPIRequest';
|
||||
import Register from '../Services/Register';
|
||||
|
||||
RunCron(
|
||||
'Basic:Alive',
|
||||
@ -15,7 +16,8 @@ RunCron(
|
||||
},
|
||||
async () => {
|
||||
if (!LocalCache.getString('PROBE', 'PROBE_ID')) {
|
||||
logger.warn('Probe is not registered yet. Skipping alive check.');
|
||||
logger.warn('Probe is not registered yet. Skipping alive check. Trying to register probe again...');
|
||||
await Register.registerProbe();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import { PROBE_API_URL, PROBE_KEY } from '../Config';
|
||||
import LocalCache from 'CommonServer/Infrastructure/LocalCache';
|
||||
import URL from 'Common/Types/API/URL';
|
||||
import logger from 'CommonServer/Utils/Logger';
|
||||
import Register from '../Services/Register';
|
||||
|
||||
RunCron(
|
||||
'Basic:Monitor',
|
||||
@ -18,7 +19,8 @@ RunCron(
|
||||
// for each monitor, ping and then report back to probe-api
|
||||
|
||||
if (!LocalCache.getString('PROBE', 'PROBE_ID')) {
|
||||
logger.warn('Probe is not registered yet. Skipping alive check.');
|
||||
logger.warn('Probe is not registered yet. Skipping alive check. Trying to register probe again...');
|
||||
await Register.registerProbe();
|
||||
return;
|
||||
}
|
||||
|
||||
|
27
Probe/jest.config.json
Normal file
27
Probe/jest.config.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"preset": "ts-jest",
|
||||
"verbose": true,
|
||||
"globals": {
|
||||
"ts-jest": {
|
||||
"tsconfig": "tsconfig.json",
|
||||
"babelConfig": false
|
||||
}
|
||||
},
|
||||
"moduleFileExtensions": ["ts", "js", "json"],
|
||||
"transform": {
|
||||
".(ts|tsx)": "ts-jest"
|
||||
},
|
||||
"testEnvironment": "node",
|
||||
"collectCoverage": true,
|
||||
"coverageReporters": ["text"],
|
||||
"testRegex": "./Tests/(.*).test.ts",
|
||||
"collectCoverageFrom": ["./**/*.(tsx||ts)"],
|
||||
"coverageThreshold": {
|
||||
"global": {
|
||||
"lines": 0,
|
||||
"functions": 0,
|
||||
"branches": 0,
|
||||
"statements": 0
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user